-
Notifications
You must be signed in to change notification settings - Fork 92
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
[QST] Cannot call device executor using host compiler #546
Comments
Hi, are you trying to run this code on the CPU or GPU? Can you pass the compilation line? Clang support for the host compiler should work. There's a separate request to have host device compilation working, but that isn't ready yet and isn't typically what people want. |
I see, Im building with cmake project("HastyCuCompute" VERSION 0.1) include(cmake/CPM.cmake) set(CMAKE_CXX_STANDARD 23) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_executable(HastyCuCompute "lib/main.cpp") set_property(TARGET HastyCuCompute PROPERTY CXX_STANDARD 23) target_sources(HastyCuCompute set(CMAKE_VERBOSE_MAKEFILE ON) find_package(CUDAToolkit REQUIRED) find_package(matx CONFIG REQUIRED) target_link_libraries(HastyCuCompute PRIVATE CUDA::toolkit) find_library(finufft REQUIRED message(${finufft}) target_link_libraries(HastyCuCompute PRIVATE ${finufft}) set_property(TARGET HastyCuCompute PROPERTY CUDA_SEPARABLE_COMPILATION ON)` presets are
|
Hi @turbotage, in general that means whatever your code was doing was trying to call a device (GPU) executor with a host compiler. It's equivalent to trying to use the CUDA <<<>>> syntax with the host compiler, which is not supported. It's possible there's a bug if you're not on the latest version since we fixed something to do with that. From your code above I noticed two things:
Let me know what your intent is and we can figure it out. |
I realize now that I perhaps missed the intent of this library. I thaught operations could be "recorded" in host code then fused to device kernels and executed on device. But I see know that the device executor requires compilation to be cuda guided (CUDACC) and the HostExecutor doesn't run on device. Is there any plans to support this in the future? |
Hi @turbotage, you can think of these expressions as a single syntax that will allow you to fuse the expression into either one host function or one device kernel. As an example: MatX/test/00_operators/OperatorTests.cu Line 469 in 389ee69
On this line we pass in So I think it already does what you want, but right now not all the functions are supported on the host. Specifically complex things like fft and matmul. Support is coming soon for the host on that . |
@turbotage does that last comment help? In summary I think the library does what you want, but possibly not in the way you expected. |
Closing. Reopen if this is still an issue. |
I have a small project in which I try to use MatX. right now I basically just create
auto coords = matx::make_tensor<float, 1>({nupts});
auto randCoordsOp = matx::random<hasty::cu_f32>(coords.Shape(), matx::UNIFORM);
(coords[0] = -3.141592f + 2*3.141592f*randCoordsOp).run();
at .run() I hit the following assert
MATX_ASSERT_STR(false, matxInvalidParameter, "Cannot call device executor using host compiler");
I am a bit confused by this. CUDACC mustn't be defined then. What am I doing wrong? I see that you don't recommend clang (which I am using) could it be due to this? Also I see there is a pull request for clang support #485
The text was updated successfully, but these errors were encountered: