Cuda gridDim and blockDim

blockDim.x,y,z gives the number of threads in a block, in the particular direction gridDim.x,y,z gives the number of blocks in a grid, in the particular direction blockDim.x * gridDim.x gives the number of threads in a grid (in the x direction, in this case) block and grid variables can be 1, 2, or 3 dimensional. … Read more

Does __syncthreads() synchronize all threads in the grid?

The __syncthreads() command is a block level synchronization barrier. That means it is safe to be used when all threads in a block reach the barrier. It is also possible to use __syncthreads() in conditional code but only when all threads evaluate identically such code otherwise the execution is likely to hang or produce unintended … Read more

Coding CUDA with C#?

There is such a nice complete cuda 4.2 wrapper as ManagedCuda. You simply add C++ cuda project to your solution, which contains yours c# project, then you just add call “%VS100COMNTOOLS%vsvars32.bat” for /f %%a IN (‘dir /b “$(ProjectDir)Kernels\*.cu”‘) do nvcc -ptx -arch sm_21 -m 64 -o “$(ProjectDir)bin\Debug\%%~na_64.ptx” “$(ProjectDir)Kernels\%%~na.cu” for /f %%a IN (‘dir /b “$(ProjectDir)Kernels\*.cu”‘) … Read more

Does CUDA support recursion?

It does on NVIDIA hardware supporting compute capability 2.0 and CUDA 3.1: New language features added to CUDA C / C++ include: Support for function pointers and recursion make it easier to port many existing algorithms to Fermi GPUs http://developer.nvidia.com/object/cuda_3_1_downloads.html Function pointers: http://developer.download.nvidia.com/compute/cuda/sdk/website/CUDA_Advanced_Topics.html#FunctionPointers Recursion: I can’t find a code sample on NVIDIA’s website, but on … Read more

Error compiling CUDA from Command Prompt

You will need to add the folder containing the “cl.exe” file to your path environment variable. For example: C:\Program Files\Microsoft Visual Studio 10.0\VC\bin Edit: Ok, go to My Computer -> Properties -> Advanced System Settings -> Environment Variables. Here look for “PATH” in the list, and add the path above (or whatever is the location … Read more

How to remove cuda completely from ubuntu?

There are two things- nvidia drivers and cuda toolkit- which you may want to remove. If you have installed using apt-get use the following to remove the packages completely from the system: To remove cuda toolkit: sudo apt-get –purge remove “*cublas*” “cuda*” “nsight*” To remove Nvidia drivers: sudo apt-get –purge remove “*nvidia*” If you have … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)