Skip to content

core: binding fix#385

Open
IvanGrigorik wants to merge 6 commits intomainfrom
grigorik/binding-fix
Open

core: binding fix#385
IvanGrigorik wants to merge 6 commits intomainfrom
grigorik/binding-fix

Conversation

@IvanGrigorik
Copy link
Copy Markdown
Collaborator

This PR fixes the binding issue for the device-sided views that are passed into host-sided kernels.


TLDR: if the default space is device, but we call the host kernel - there will be an issue with argument memory layout (Left vs Right). This case should be handled by our side


When a host-space kernel (e.g., pk.Serial) is run in a device context, the Python side passes views that live in GPU memory (CudaUVMSpace, LayoutLeft), while the generated C++ binding expects host views with the host execution space’s layout (HostSpace, LayoutRight for Serial).

Pybind11 can't automatically cast these types, so we should handle that on our side.
This PR introduces function _generate_mirror_with_exec_layout which is handling this case

This PR also adds a compilation check. We should always check if the concrete module file exists, not the module directory.

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

Successfully merging this pull request may close these issues.

1 participant