NVIDIA / jitify

A single-header C++ library for simplifying the use of CUDA Runtime Compilation (NVRTC).
BSD 3-Clause "New" or "Revised" License
516 stars 64 forks source link

sizeof(CUdeviceptr)==4 on the device side code #48

Open devshgraphicsprogramming opened 4 years ago

devshgraphicsprogramming commented 4 years ago

I ran into a problem when compiling some optix programs

More info here as well as a reproducible example https://devtalk.nvidia.com/default/topic/1072808/optix/-bugreport-amp-fix-optix-7-corrupts-cudeviceptr-in-the-sbt-due-to-truncation-hardcore-/?offset=2#5434966

I'm using your "stddef.h" no idea what is the proper way to fix it and have my kernels compiled by nvrtc have 8 byte pointers.

benbarsdell commented 4 years ago

I only had a quick look at this so far but can you try compiling with _M_AMD64 or __x86_64 defined.

benbarsdell commented 4 years ago

Sorry actually for Windows it requires defining _WIN64 or __LP64__ as noted here. E.g., pass -D_WIN64 and/or -D__LP64__ as compiler options to Jitify (NVRTC).

If this works I'll look into whether we could/should define these automatically.