Answer the question
In order to leave comments, you need to log in
Implementation of dynamic expressions in C#. Library for working with OpenCL Cudafy.NET?
In general, my question is from the category, but how does it work? In particular, the Cudafy library ( http://cudafy.codeplex.com)
For example, in the example below, the static function method thekernel() of the simple_kernel class from another gpu class is called.
To be honest, I would never have thought it was possible.
I read the article from
msdn.microsoft.com/en-us/library/dd264736.aspx the only thing that dynamic linking understood is that it avoids errors at compile time, but not at runtime.
So there are still more questions than answers.
/*
* This software is based upon the book CUDA By Example by Sanders and Kandrot
* and source code provided by NVIDIA Corporation.
* It is a good idea to read the book while studying the examples!
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cudafy;
using Cudafy.Host;
using Cudafy.Translator;
namespace CudafyByExample
{
public class simple_kernel
{
public static void Execute()
{
CudafyModule km = CudafyTranslator.Cudafy(eArchitecture.OpenCL);
GPGPU gpu = CudafyHost.GetDevice(CudafyModes.Target, CudafyModes.DeviceId);
gpu.LoadModule(km);
gpu.Launch().thekernel(); // or gpu.Launch(1, 1, "kernel");
Console.WriteLine("Hello, World!");
}
[Cudafy]
public static void thekernel()
{
}
}
}
>
Answer the question
In order to leave comments, you need to log in
An interesting article, live a century, as they say, learn a century. As I understand gpu.Launch() return dinamyc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question