All Projects → lepoco → CUDAfy.NET

lepoco / CUDAfy.NET

Licence: LGPL-2.1 license
CUDAfy .NET allows easy development of high performance GPGPU applications completely from the .NET. It's developed in C#.

Programming Languages

C#
18002 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to CUDAfy.NET

learn-gpgpu
Algorithms implemented in CUDA + resources about GPGPU
Stars: ✭ 37 (-33.93%)
Mutual labels:  opencl, nvidia, gpgpu, gpu-computing
Cuda Api Wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
Stars: ✭ 362 (+546.43%)
Mutual labels:  nvidia, gpgpu, gpu-computing
Clojurecl
ClojureCL is a Clojure library for parallel computations with OpenCL.
Stars: ✭ 266 (+375%)
Mutual labels:  opencl, nvidia, gpu-computing
gpuowl
GPU Mersenne primality test.
Stars: ✭ 77 (+37.5%)
Mutual labels:  opencl, gpgpu, gpu-computing
Parenchyma
An extensible HPC framework for CUDA, OpenCL and native CPU.
Stars: ✭ 71 (+26.79%)
Mutual labels:  opencl, nvidia, gpgpu
Ilgpu
ILGPU JIT Compiler for high-performance .Net GPU programs
Stars: ✭ 374 (+567.86%)
Mutual labels:  opencl, nvidia, gpgpu
Hipsycl
Implementation of SYCL for CPUs, AMD GPUs, NVIDIA GPUs
Stars: ✭ 377 (+573.21%)
Mutual labels:  opencl, gpgpu, gpu-computing
Arraymancer
A fast, ergonomic and portable tensor library in Nim with a deep learning focus for CPU, GPU and embedded devices via OpenMP, Cuda and OpenCL backends
Stars: ✭ 793 (+1316.07%)
Mutual labels:  opencl, gpgpu, gpu-computing
Neanderthal
Fast Clojure Matrix Library
Stars: ✭ 927 (+1555.36%)
Mutual labels:  opencl, gpgpu, gpu-computing
Cekirdekler
Multi-device OpenCL kernel load balancer and pipeliner API for C#. Uses shared-distributed memory model to keep GPUs updated fast while using same kernel on all devices(for simplicity).
Stars: ✭ 76 (+35.71%)
Mutual labels:  opencl, gpgpu, gpu-computing
Computecpp Sdk
Collection of samples and utilities for using ComputeCpp, Codeplay's SYCL implementation
Stars: ✭ 239 (+326.79%)
Mutual labels:  opencl, gpgpu
Occa
JIT Compilation for Multiple Architectures: C++, OpenMP, CUDA, HIP, OpenCL, Metal
Stars: ✭ 230 (+310.71%)
Mutual labels:  opencl, gpgpu
Pine
🌲 Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
Stars: ✭ 202 (+260.71%)
Mutual labels:  opencl, nvidia
Opencl Intercept Layer
Intercept Layer for Debugging and Analyzing OpenCL Applications
Stars: ✭ 189 (+237.5%)
Mutual labels:  opencl, gpgpu
gmp
Unofficial GMP with added custom native Visual Studio project build tools. GMP: GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers.
Stars: ✭ 61 (+8.93%)
Mutual labels:  visual-studio, visualstudio
nettle
Unofficial Nettle with added custom native Visual Studio project build tools. Nettle: Nettle is a cryptographic library that is designed to fit easily in more or less any context.
Stars: ✭ 19 (-66.07%)
Mutual labels:  visual-studio, visualstudio
vs-editor-api
Microsoft Visual Studio Editor API definitions
Stars: ✭ 109 (+94.64%)
Mutual labels:  visual-studio, visualstudio
Clinfo
Print all known information about all available OpenCL platforms and devices in the system
Stars: ✭ 186 (+232.14%)
Mutual labels:  opencl, gpgpu
MvsSln
🧩 Customizable VisualStudio .sln parser, Complex support of the projects (.vcxproj, .csproj., …), Pluginable lightweight r/w handlers at runtime, and more …
Stars: ✭ 86 (+53.57%)
Mutual labels:  visual-studio, visualstudio
libssh
Unofficial LibSSH with added custom native Visual Studio project build tools. LibSSH: Mulitplatform C library implementing the SSHv2 and SSHv1 protocol for client and server implementations.
Stars: ✭ 21 (-62.5%)
Mutual labels:  visual-studio, visualstudio

Logo

The problem



The Cudafy.Translator library must be rewritten, hence the question arises whether it makes sense to continue the work of the Hybrid DSP, or to rewrite everything from scratch with the MIT license.

If anyone is willing to cooperate, please contact me. Currently, everything is basically rewritten to .NET 6. The Cudafy.Translator library fails to compile due to problems with Decompiler, NRefactory and ILSpy.

If you want, you can download the last successful compilation of the library here.
Source code of the library, before .NET6 refactor, can be downloaded here
The original repository is no longer available for download. CodePlex has been shutted down



CUDAfy.NET

CUDA 11 & Visual Studio 2022
CUDAfy.NET access to work with Visual Studio 2022 and the latest NVIDIA Toolkit CUDA 11 library.

This repository uses the source code created by Hybrid DSP to create a derivative work under the LGPL license.

What is CUDAfy?

CUDAfy .NET allows easy development of high performance GPGPU applications completely from the .NET. It's developed in C#.
Modern graphics cards provide the potential of massive speed increase over CPUs for non-graphics related intensive numeric operations. Many large data set operations such as matrices can see a 100x or more speed up. CUDAfy allows .NET developers to easily create complex applications that split processing cleanly between host and GPU. There are no separate CUDA cu files or complex set-up procedures to launch GPU device functions. It follows the CUDA programming model and any knowledge gained from tutorials or books on CUDA can be easily transferred to CUDAfy, only in a clean .NET fashion.

How to start with CUDAfy?

Required components

  • x64 Windows or Linux
  • Visual Studio 2022
  • MSVC v142 x64 / 86 build tools (v.14.24) or higher
  • .NET Framework 4.8 | .NET 6

Launching

  1. Download the latest repository
  2. Open the Cudafy.sln project
  3. Choose the "Debug" solution
  4. Choose the "x64" solution platforms
  5. Choose the "Cudafy.Demo" startup project
  6. Rebuild whole project
  7. Start "Cudafy.Demo"

What's new?

  • Automatic support for versions 10.2, 10.1 and 11.
  • A new way to detect Visual Studio locations with the MSVC package.
  • Corrections in the code of some test programs.
  • Almost complete removal of x86 support.
  • Removal of unnecessary Solutions.
  • Some new errors to display.

Where can I find CUDA Toolkit?

You can download the latest CUDA version from the official NVIDIA website NVIDIA CUDA Toolkit

Example program

Example program

Here is an example program you can run using compiled libraries.

class Program
{
    public const int N = 10;
    public static void Main()
    {
        Console.WriteLine("CUDAfy Example\nCollecting necessary resources...");

        CudafyModes.Target = eGPUType.Cuda; // To use OpenCL, change this enum
        CudafyModes.DeviceId = 0;
        CudafyTranslator.Language = CudafyModes.Target == eGPUType.OpenCL ? eLanguage.OpenCL : eLanguage.Cuda;

        //Check for available devices
        if (CudafyHost.GetDeviceCount(CudafyModes.Target) == 0)
            throw new System.ArgumentException("No suitable devices found.", "original");

        //Init device
        GPGPU gpu = CudafyHost.GetDevice(CudafyModes.Target, CudafyModes.DeviceId);
        Console.WriteLine("Running example using {0}", gpu.GetDeviceProperties(false).Name);

        //Load module for GPU
        CudafyModule km = CudafyTranslator.Cudafy();
        gpu.LoadModule(km);

        //Define local arrays
        int[] a = new int[N];
        int[] b = new int[N];
        int[] c = new int[N];

        // allocate the memory on the GPU
        int[] dev_c = gpu.Allocate<int>(c);

        // fill the arrays 'a' and 'b' on the CPU
        for (int i = 0; i < N; i++)
        {
            a[i] = i;
            b[i] = i * i;
        }

        // copy the arrays 'a' and 'b' to the GPU
        int[] dev_a = gpu.CopyToDevice(a);
        int[] dev_b = gpu.CopyToDevice(b);

        gpu.Launch(1, N).add(dev_a, dev_b, dev_c);

        // copy the array 'c' back from the GPU to the CPU
        gpu.CopyFromDevice(dev_c, c);

        // display the results
        for (int i = 0; i < N; i++)
            Console.WriteLine("{0} + {1} = {2}", a[i], b[i], c[i]);

        // free the memory allocated on the GPU
        gpu.FreeAll();

        Console.WriteLine("Done!");
        Console.ReadKey();
    }

    [Cudafy]
    public static void add(GThread thread, int[] a, int[] b, int[] c)
    {
        int tid = thread.threadIdx.x;
        if (tid < N)
            c[tid] = a[tid] + b[tid];
    }
}

License

Cudafy.NET was created by Hybrid DSP under LGPL v2.1 License.

The LGPL v2.1 License applies to CUDAfy .NET. If you wish to modify the code then changes should be re-submitted to Hybrid DSP. If you wish to incorporate Cudafy.NET into your own application instead of redistributing the dll's then please consider a commerical license. Visit http://www.hybriddsp.com. This will also provide you with priority support and contribute to on-going development.

The following libraries are made use of:
The MIT license applies to ILSpy, NRefactory and ICSharpCode.Decompiler (Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop team).
Mono.Cecil also uses the MIT license (Copyright JB Evain).
CUDA.NET is a free for use license (Copyright Company for Advanced Supercomputing Solutions Ltd)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].