Jump to content
  • Similar Content

    • scintilla4evr
      By scintilla4evr
      This is a small wrapper UDF for NVIDIA CUDA Driver API. It enables AutoIt scripts to execute pre-compiled .cubin programs on NVIDIA GPU's and receive data from them.
    • Andreik
      By Andreik
      Does anyone tried with success to compile a dll with a function that use CUDA and then to call the function from AutoIt? Actually the compilation seems to be easy but it might be a little hard to call the function. Here is what I have:
      #include <cuda.h> #include <cuda_runtime.h> #include <device_launch_parameters.h> __global__ void cuda__add(int *a, int *b, int *c) { *c = *a + *b; } extern "C" __declspec(dllexport) int Add(int a, int b) { int c; int *dev_a,*dev_b,*dev_c; int size = sizeof(int); cudaMalloc((void**)&dev_a, size); cudaMalloc((void**)&dev_b, size); cudaMalloc((void**)&dev_c, size); cudaMemcpy(dev_a, &a,sizeof(int), cudaMemcpyHostToDevice); cudaMemcpy(dev_b, &b,sizeof(int), cudaMemcpyHostToDevice); cuda__add<<< 1,1 >>>(dev_a,dev_b,dev_c); cudaMemcpy(&c, dev_c,size, cudaMemcpyDeviceToHost); cudaFree(&dev_a); cudaFree(&dev_b); cudaFree(&dev_c); return c; } I am able to open the dll but the function is not visible somehow and I get error 3 when I call it from AutoIt.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.