Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Add example of writing a user-defined compute kernel #174

Open
wjones127 opened this issue Apr 4, 2022 · 5 comments
Open

[C++] Add example of writing a user-defined compute kernel #174

wjones127 opened this issue Apr 4, 2022 · 5 comments

Comments

@wjones127
Copy link
Member

No description provided.

@drin
Copy link

drin commented Jun 30, 2022

I have something that I think would work as an initial pass for this. I have a recipe here:

https://github.com/drin/cookbooks/tree/mainline/arrow/add-compute-fn

What would be the best way to move the recipe into this repo to submit a PR? I formatted the directory to be self-contained, but looking at other recipes in this repo, it seems like it's preferred to keep code mostly self-contained within a single source file.

Is there a preference on how to clearly distinguish what is necessary in the header file?

After some suggestions I can prepare an initial PR.

@wjones127
Copy link
Member Author

I think the cookbook approach is to just show the minimal necessary code within the source file, and not necessarily show how one might separate declarations into headers.

Personally, I think it would be helpful to have two examples:

  1. In the cookbook, just show the minimal source code necessary in one file to write, register, and call a compute kernel.
  2. In a separate repo, show a full project structure for writing compute kernels in a C++ project. Bonus points if it shows how to make Python bindings that can register with PyArrow's compute registry (and similarly with the R package and others).

@drin
Copy link

drin commented Jul 7, 2022

Thanks! (1) sounds easily doable. For (2), I guess the repo where I have it now (drin/cookbooks.git) is a reasonable place to keep it. I'll try to expand with python bindings. I'll see about how to do R bindings in the near-ish future.

@drin
Copy link

drin commented Jul 8, 2022

Created a draft PR: #227

@drin
Copy link

drin commented Jul 8, 2022

decided to just mark it ready for review. not sure there's any need to keep it as a draft

drin added a commit to drin/arrow-cookbook that referenced this issue Jul 28, 2022
Trying to see if moving these recipe labels captures C++ code blocks
outside of function bodies
drin added a commit to drin/arrow-cookbook that referenced this issue Jul 28, 2022
I am trying the literalinclude directive first before trying to use
recipe directives in comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants