Posts

How to convert C# code to CUDAfy

Image
CUDA is wisely use because it get less computation time. CUDA suits for more computational project like adding very large matrix. But thing is it can use only C and C++ languages. Converting C# into CUDAfy language is little bit difficult because CUDAfy did not have any inbuilt functions. So we have to implement the every function that we need. CUDAfy only allowed use primitive data type arrays. In this case we have to implement functions and other data types using primitive types arrays. Primitive data types are boolean , byte , char , short , int , long , float and double. In this blog I tried to implement some function and data types in C# to CUDAfy. First you make sure that you have working environment of CUDAfy, Follow this link for setting CUDAfy environment in your machine. http://cudafy.blogspot.com/2017/06/use-cuda-for-c-language.html Firstly I create a CUDAfy Tuple data type.Open a new C# class and add these three lines in top of the class. After this ...

Use CUDA for C# language

Image
First you should check your machine is compatible for CUDA. CUDA is need a NVIDIA graphic card. To check that go to “Control Panel\System and Security\System” and open Device Manager. Under Device Manager there is a entry called Display adapters expand it and find your graphic card details. There are some CUDA capable GPUs in that link.  https://developer.nvidia.com/cuda-gpus Link for downloading NVIDIA CUDA Toolkit:  https://developer.nvidia.com /cuda-downloads To run CUDA program use Visual Studio 2012 or 2013.  You have to make sure that restart your machine after Install the NVIDIA CUDA toolkit. After this you can test a sample code of CUDA C and verify the CUDA C is working properly in your machine. After you install the NVIDIA CUDA Toolkit, there is some sample codes to test your machine. Path of the sample code: “C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0 <category>\name of the sample” Before going to the CUDA C# you have to add the...