This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 757
thrust::system::cuda::detail::deallocation_fn type mismatch with cudaFree #1458
Labels
P1: should have
Necessary, but not critical.
repro: verified
The provided repro has been validated.
type: bug: functional
Does not work as intended.
Milestone
Comments
@Mochimazui What flags are you using? I built and ran the snippet above, but everything looks ok with our build system:
|
Closing, cannot reproduce. Please reopen with more info if this is still needed. |
This happens when CUDA is used by 32-bit build. In 64-bit build, Thus, the fix (for 32-bit compatible usage) should be:
|
Thanks for the info -- reopening. |
alliepiper
added a commit
to alliepiper/thrust
that referenced
this issue
Dec 16, 2021
CUDA runtime functions are annotated with CUDARTAPI, which expands to __stdcall on MSVC. `thrust/system/cuda/memory_resource.h` defines some function pointer types intended for use with CUDART memory allocation/deallocation functions, but they lack the CUDARTAPI markup. Added this markup to fix 32-bit builds. Repro'd issue and validated fix on MSVC 2019. Fixes NVIDIA#1458.
@Mochimazui @ojakubcik #1582 should fix this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
P1: should have
Necessary, but not critical.
repro: verified
The provided repro has been validated.
type: bug: functional
Does not work as intended.
Using VS2019 Version 16.10.1 and thurst code from CUDA 11.3.1 installation.
Build failes on "thrust/system/cuda/memory_resource.h:87" with error
a value of type "cudaError_t (*)(void *)" cannot be used to initialize an entity of type "deallocation_fn"
cudaFree type is
enum cudaError (__stdcall*)(void *)
but deallocation_fn type isenum cudaError (__cdecl*)(void *)
.Seems we need add __stdcall to deallocation_fn, or modify cuda_memory_resource template to allow both __cdecl and __stcall function pointer here.
Code:
The text was updated successfully, but these errors were encountered: