Category : cuda

I have a class that wraps CUDA kernels. I create a shared pointer for the wrapper class then call the desired function that calls the CUDA kernel. … object1 = std::make_shared(…); object1->findSurface(); … object1 = nullptr; … object2 = std::make_shared(…); object2->findSurface(); … There are no errors produced, however when the object1 = nullptr is removed ..

Read more

I have a vector that needs data from the cuda kernel copied to it. However, I’m running into issues doing so with conflicts on pointers and types but I have no clue where to start. std::vector<int> values; cudaMemcpy(values.data(), values_return, size, cudaMemcpyDeviceToHost); So I might be able to grasp some reasoning why this is not allowed ..

Read more

I’m getting the following error when using CMake 3.21.2 for GVDB Voxels: CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeDetermineCompilerId.cmake:497 (message): No CUDA toolset found. Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD) C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeDetermineCompilerId.cmake:59 (__determine_compiler_id_test) C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeDetermineCUDACompiler.cmake:283 (CMAKE_DETERMINE_COMPILER_ID) source/gvdb_library/CMakeLists.txt:12 (project) CUDA 11.4.2 appears to be compatible with Visual Studio 2019, so I don’t know what the ..

Read more

I wish to convert a CUDA code in C or C++. Let me take an example of a snippet of the CUDA code. template<typename S> void bind(texture<S,1,cudaReadModeElementType> &tex) { tex.addressMode[0] = cudaAddressModeWrap; tex.addressMode[1] = cudaAddressModeWrap; tex.filterMode = cudaFilterModePoint; tex.normalized = false; CUDA_SAFE_CALL(cudaBindTexture(0, tex, (S*)DEVC, SIZE*sizeof(T))); } And another example: texture<uint4, 1, cudaReadModeElementType> texCell; How can ..

Read more

I’m trying to understand how CUDA assert works under the hood. The assert macro calls the __assert_fail function, of which I can find the following signatures: /usr/include/assert.h:extern void __assert_fail (const char *__assertion, const char *__file, /usr/local/cuda-10.2/targets/x86_64-linux/include/crt/common_functions.h:extern __host__ __device__ __cudart_builtin__ void __assert_fail( I can see they have the same signature, however the CUDA version has __host__ ..

Read more