elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación C/C++ (Moderadores: Eternal Idol, Littlehorse, K-YreX)
| | |-+  OpenCL + Ati STREAM + CUDA.
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: OpenCL + Ati STREAM + CUDA.  (Leído 6,647 veces)
APOKLIPTICO


Desconectado Desconectado

Mensajes: 3.871


Toys in the attic.


Ver Perfil
OpenCL + Ati STREAM + CUDA.
« en: 22 Septiembre 2010, 16:57 pm »

Hola gente, como va todo? Acabo de compilar un programa de prueba que utiliza OpenCL. OpenCL es una plataforma que unifica el GPGPU, realmente me pareció muy buena, el tema es que yo solo tengo una Ati HD4850, no tengo ninguna Nvidia para probar, alguien podría hacerme el favor?? Osea, en definitiva lo que necesitaría es el vendor ID de nvidia para agregarlo al programa, una vez que haga esto, se puede adaptar para que funcione con ambas plataformas! No es genial?.

Bueno este es el código en cuestion, se basa en un template de el SDK de Ati Stream modificado, este es el código en cuestión:

main.cpp:


Código
  1. #include "main.hpp"
  2. std::string
  3. convertToString(const char *filename)
  4. {
  5.    size_t size;
  6.    char*  str;
  7.    std::string s;
  8.  
  9.    std::fstream f(filename, (std::fstream::in | std::fstream::binary));
  10.  
  11.    if(f.is_open())
  12.    {
  13.        size_t fileSize;
  14.        f.seekg(0, std::fstream::end);
  15.        size = fileSize = f.tellg();
  16.        f.seekg(0, std::fstream::beg);
  17.  
  18.        str = new char[size+1];
  19.        if(!str)
  20.        {
  21.            f.close();
  22.            return NULL;
  23.        }
  24.  
  25.        f.read(str, fileSize);
  26.        f.close();
  27.        str[size] = '\0';
  28.  
  29.        s = str;
  30.        delete[] str;
  31.        return s;
  32.    }
  33.    else
  34.    {
  35.        std::cout << "\nFile containg the kernel code(\".cl\") not found. Please copy the required file in the folder containg the executable.\n";
  36.        exit(1);
  37.    }
  38.    return NULL;
  39. }
  40. int
  41. initializeHost(void)
  42. {
  43.    width               = 102400;
  44.    output                = NULL;
  45.  
  46.    /////////////////////////////////////////////////////////////////
  47.    // Allocate and initialize memory used by host
  48.    /////////////////////////////////////////////////////////////////
  49.    cl_uint sizeInBytes = width * sizeof(cl_uint);
  50.  
  51.    output = (cl_uint *) malloc(sizeInBytes);
  52.    if(output == NULL)
  53.    {
  54.        std::cout<<"Error: Failed to allocate output memory on host\n";
  55.        return 1;
  56.    }
  57.  
  58.    return 0;
  59. }
  60. int
  61. initializeCL(bool UseGPU)
  62. {
  63.    cl_int status = 0;
  64.    size_t deviceListSize;
  65.  
  66.    /*
  67.      * Have a look at the available platforms and pick either
  68.      * the AMD one if available or a reasonable default.
  69.      */
  70.  
  71.    cl_uint numPlatforms;
  72.    cl_platform_id platform = NULL;
  73.    status = clGetPlatformIDs(0, NULL, &numPlatforms);
  74.    if(status != CL_SUCCESS)
  75.    {
  76.        std::cout << "Error: Getting Platforms. (clGetPlatformsIDs)\n";
  77.        return 1;
  78.    }
  79.  
  80.    if(numPlatforms > 0)
  81.    {
  82.        cl_platform_id* platforms = new cl_platform_id[numPlatforms];
  83.        status = clGetPlatformIDs(numPlatforms, platforms, NULL);
  84.        if(status != CL_SUCCESS)
  85.        {
  86.            std::cout << "Error: Getting Platform Ids. (clGetPlatformsIDs)\n";
  87.            return 1;
  88.        }
  89.        for(unsigned int i=0; i < numPlatforms; ++i)
  90.        {
  91.            char pbuff[100];
  92.            status = clGetPlatformInfo(
  93.                        platforms[i],
  94.                        CL_PLATFORM_VENDOR,
  95.                        sizeof(pbuff),
  96.                        pbuff,
  97.                        NULL);
  98.            if(status != CL_SUCCESS)
  99.            {
  100.                std::cout << "Error: Getting Platform Info.(clGetPlatformInfo)\n";
  101.                return 1;
  102.            }
  103.            platform = platforms[i];
  104.            if(!strcmp(pbuff, "Advanced Micro Devices, Inc."))
  105.            {
  106.                break;
  107.            }
  108.        }
  109.        delete platforms;
  110.    }
  111.  
  112.    if(NULL == platform)
  113.    {
  114.        std::cout << "NULL platform found so Exiting Application." << std::endl;
  115.        return 1;
  116.    }
  117.  
  118.    /*
  119.      * If we could find our platform, use it. Otherwise use just available platform.
  120.      */
  121.    cl_context_properties cps[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties)platform, 0 };
  122.  
  123.    /////////////////////////////////////////////////////////////////
  124.    // Create an OpenCL context
  125.    /////////////////////////////////////////////////////////////////
  126.    if(UseGPU) context = clCreateContextFromType(cps, CL_DEVICE_TYPE_GPU, NULL, NULL, &status);
  127.    else context = clCreateContextFromType(cps, CL_DEVICE_TYPE_CPU, NULL, NULL, &status);
  128.    if(status != CL_SUCCESS)
  129.    {
  130.        std::cout<<"Error: Creating Context. (clCreateContextFromType)\n";
  131.        return 1;
  132.    }
  133.  
  134.    /* First, get the size of device list data */
  135.    status = clGetContextInfo(context,
  136.                              CL_CONTEXT_DEVICES,
  137.                              0,
  138.                              NULL,
  139.                              &deviceListSize);
  140.    if(status != CL_SUCCESS)
  141.    {
  142.        std::cout<<
  143.            "Error: Getting Context Info \
  144.            (device list size, clGetContextInfo)\n";
  145.        return 1;
  146.    }
  147.  
  148.    /////////////////////////////////////////////////////////////////
  149.    // Detect OpenCL devices
  150.    /////////////////////////////////////////////////////////////////
  151.    devices = (cl_device_id *)malloc(deviceListSize);
  152.    if(devices == 0)
  153.    {
  154.        std::cout<<"Error: No devices found.\n";
  155.        return 1;
  156.    }
  157.  
  158.    /* Now, get the device list data */
  159.    status = clGetContextInfo(
  160.                 context,
  161.                 CL_CONTEXT_DEVICES,
  162.                 deviceListSize,
  163.                 devices,
  164.                 NULL);
  165.    if(status != CL_SUCCESS)
  166.    {
  167.        std::cout<<
  168.            "Error: Getting Context Info \
  169.            (device list, clGetContextInfo)\n";
  170.        return 1;
  171.    }
  172.  
  173.    /////////////////////////////////////////////////////////////////
  174.    // Create an OpenCL command queue
  175.    /////////////////////////////////////////////////////////////////
  176.    commandQueue = clCreateCommandQueue(
  177.                       context,
  178.                       devices[0],
  179.                       0,
  180.                       &status);
  181.    if(status != CL_SUCCESS)
  182.    {
  183.        std::cout<<"Creating Command Queue. (clCreateCommandQueue)\n";
  184.        return 1;
  185.    }
  186.  
  187.    /////////////////////////////////////////////////////////////////
  188.    // Create OpenCL memory buffers
  189.    /////////////////////////////////////////////////////////////////
  190.  
  191.    outputBuffer = clCreateBuffer(
  192.                       context,
  193.                       CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR,
  194.                       sizeof(cl_uint) * width,
  195.                       output,
  196.                       &status);
  197.    if(status != CL_SUCCESS)
  198.    {
  199.        std::cout<<"Error: clCreateBuffer (outputBuffer)\n";
  200.        return 1;
  201.    }
  202.  
  203.  
  204.    /////////////////////////////////////////////////////////////////
  205.    // Load CL file, build CL program object, create CL kernel object
  206.    /////////////////////////////////////////////////////////////////
  207.    const char * filename  = "kernel.cl";
  208.    std::string  sourceStr = convertToString(filename);
  209.    const char * source    = sourceStr.c_str();
  210.    size_t sourceSize[]    = { strlen(source) };
  211.  
  212.    program = clCreateProgramWithSource(
  213.                  context,
  214.                  1,
  215.                  &source,
  216.                  sourceSize,
  217.                  &status);
  218.    if(status != CL_SUCCESS)
  219.    {
  220.      std::cout<<
  221.               "Error: Loading Binary into cl_program \
  222.               (clCreateProgramWithBinary)\n";
  223.      return 1;
  224.    }
  225.  
  226.    /* create a cl program executable for all the devices specified */
  227.    status = clBuildProgram(program, 1, devices, NULL, NULL, NULL);
  228.    if(status != CL_SUCCESS)
  229.    {
  230.        std::cout<<"Error: Building Program (clBuildProgram)\n";
  231.        return 1;
  232.    }
  233.  
  234.    /* get a kernel object handle for a kernel with the given name */
  235.    kernel = clCreateKernel(program, "Prime", &status);
  236.    if(status != CL_SUCCESS)
  237.    {
  238.        std::cout<<"Error: Creating Kernel from program. (clCreateKernel)\n";
  239.        return 1;
  240.    }
  241.  
  242.    return 0;
  243. }
  244.  
  245.  
  246. /*
  247.  * \brief Run OpenCL program
  248.  *
  249.  *        Bind host variables to kernel arguments
  250.  *          Run the CL kernel
  251.  */
  252. int
  253. runCLKernels(void)
  254. {
  255.    cl_int   status;
  256.    cl_uint maxDims;
  257.    cl_event events[2];
  258.     size_t maxWorkGroupSize;
  259.    size_t maxWorkItemSizes[3];
  260.  
  261.    /**
  262.     * Query device capabilities. Maximum
  263.     * work item dimensions and the maximmum
  264.     * work item sizes
  265.     */
  266.    status = clGetDeviceInfo(
  267.        devices[0],
  268.        CL_DEVICE_MAX_WORK_GROUP_SIZE,
  269.        sizeof(size_t),
  270.        (void*)&maxWorkGroupSize,
  271.        NULL);
  272.    if(status != CL_SUCCESS)
  273.    {
  274.        std::cout<<"Error: Getting Device Info. (clGetDeviceInfo)\n";
  275.        return 1;
  276.    }
  277.  
  278.    status = clGetDeviceInfo(
  279.        devices[0],
  280.        CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS,
  281.        sizeof(cl_uint),
  282.        (void*)&maxDims,
  283.        NULL);
  284.    if(status != CL_SUCCESS)
  285.    {
  286.        std::cout<<"Error: Getting Device Info. (clGetDeviceInfo)\n";
  287.        return 1;
  288.    }
  289.  
  290.    status = clGetDeviceInfo(
  291.        devices[0],
  292.        CL_DEVICE_MAX_WORK_ITEM_SIZES,
  293.        sizeof(size_t)*maxDims,
  294.        (void*)maxWorkItemSizes,
  295.        NULL);
  296.    if(status != CL_SUCCESS)
  297.    {
  298.        std::cout<<"Error: Getting Device Info. (clGetDeviceInfo)\n";
  299.        return 1;
  300.    }
  301.  
  302.    /*** Set appropriate arguments to the kernel ***/
  303.    /* the output array to the kernel */
  304.    status = clSetKernelArg(
  305.                    kernel,
  306.                    0,
  307.                    sizeof(cl_mem),
  308.                    (void *)&outputBuffer);
  309.    if(status != CL_SUCCESS)
  310.    {
  311.        std::cout<<"Error: Setting kernel argument. (output)\n";
  312.        return 1;
  313.    }
  314.    status = clGetKernelWorkGroupInfo(kernel,
  315.        devices[0],
  316.        CL_KERNEL_LOCAL_MEM_SIZE,
  317.        sizeof(cl_ulong),
  318.        &usedLocalMemory,
  319.        NULL);
  320.    if(status != CL_SUCCESS)
  321.    {
  322.        std::cout<<"clGetKernelWorkGroupInfo CL_KERNEL_LOCAL_MEM_SIZE failed." << std::endl;
  323.        return 1;
  324.    }
  325.  
  326.    if(usedLocalMemory > totalLocalMemory)
  327.    {
  328.        std::cout << "Unsupported: Insufficient local memory on device" << std::endl;
  329.        return 1;
  330.    }
  331.  
  332.    /* Check group size against group size returned by kernel */
  333.    status = clGetKernelWorkGroupInfo(kernel,
  334.        devices[0],
  335.        CL_KERNEL_WORK_GROUP_SIZE,
  336.        sizeof(size_t),
  337.        &kernelWorkGroupSize,
  338.        0);
  339.    if(status != CL_SUCCESS)
  340.    {
  341.        std::cout<<"clGetKernelWorkGroupInfo CL_KERNEL_COMPILE_WORK_GROUP_SIZE failed." << std::endl;
  342.        return 1;
  343.    }
  344.  
  345.    if(groupSize > kernelWorkGroupSize)
  346.    {
  347.        std::cout << "Out of Resources!" << std::endl;
  348.        std::cout << "Group Size specified : " << groupSize << std::endl;
  349.        std::cout << "Max Group Size supported on the kernel : " << kernelWorkGroupSize << std::endl;
  350.        std::cout << "Falling back to " << kernelWorkGroupSize << std::endl;
  351.        groupSize = kernelWorkGroupSize;
  352.    }
  353.    /*
  354.      * Enqueue a kernel run call.
  355.      */
  356.    size_t globalThreads[] = {width};
  357.    size_t localThreads[] = {1};
  358.    if(localThreads[0] > maxWorkItemSizes[0] ||
  359.       localThreads[0] > maxWorkGroupSize)
  360.    {
  361.        std::cout << "Unsupported: Device" "does not support requested number of work items.";
  362.        return 1;
  363.    }
  364.    status = clEnqueueNDRangeKernel(
  365.                 commandQueue,
  366.                 kernel,
  367.                 1,
  368.                 NULL,
  369.                 globalThreads,
  370.                 localThreads,
  371.                 0,
  372.                 NULL,
  373.                 &events[0]);
  374.    if(status != CL_SUCCESS)
  375.    {
  376.        std::cout<<
  377.            "Error: Enqueueing kernel onto command queue. \
  378.            (clEnqueueNDRangeKernel)\n";
  379.        return 1;
  380.    }
  381.  
  382.  
  383.    /* wait for the kernel call to finish execution */
  384.    status = clWaitForEvents(1, &events[0]);
  385.    if(status != CL_SUCCESS)
  386.    {
  387.        std::cout<<
  388.            "Error: Waiting for kernel run to finish. \
  389.            (clWaitForEvents)\n";
  390.        return 1;
  391.    }
  392.  
  393.    status = clReleaseEvent(events[0]);
  394.    if(status != CL_SUCCESS)
  395.    {
  396.        std::cout<<
  397.            "Error: Release event object. \
  398.            (clReleaseEvent)\n";
  399.        return 1;
  400.    }
  401.  
  402.    /* Enqueue readBuffer*/
  403.    status = clEnqueueReadBuffer(
  404.                commandQueue,
  405.                outputBuffer,
  406.                CL_TRUE,
  407.                0,
  408.                width * sizeof(cl_uint),
  409.                output,
  410.                0,
  411.                NULL,
  412.                &events[1]);
  413.  
  414.    if(status != CL_SUCCESS)
  415.    {
  416.        std::cout <<
  417.            "Error: clEnqueueReadBuffer failed. \
  418.             (clEnqueueReadBuffer)\n";
  419.  
  420.        return 1;
  421.    }
  422.  
  423.    /* Wait for the read buffer to finish execution */
  424.    status = clWaitForEvents(1, &events[1]);
  425.    if(status != CL_SUCCESS)
  426.    {
  427.        std::cout<<
  428.            "Error: Waiting for read buffer call to finish. \
  429.            (clWaitForEvents)\n";
  430.        return 1;
  431.    }
  432.  
  433.    status = clReleaseEvent(events[1]);
  434.    if(status != CL_SUCCESS)
  435.    {
  436.        std::cout<<
  437.            "Error: Release event object. \
  438.            (clReleaseEvent)\n";
  439.        return 1;
  440.    }
  441.  
  442.    return 0;
  443. }
  444.  
  445.  
  446. /*
  447.  * \brief Release OpenCL resources (Context, Memory etc.)
  448.  */
  449. int
  450. cleanupCL(void)
  451. {
  452.    cl_int status;
  453.  
  454.    status = clReleaseKernel(kernel);
  455.    if(status != CL_SUCCESS)
  456.    {
  457.        std::cout<<"Error: In clReleaseKernel \n";
  458.        return 1;
  459.    }
  460.    status = clReleaseProgram(program);
  461.    if(status != CL_SUCCESS)
  462.    {
  463.        std::cout<<"Error: In clReleaseProgram\n";
  464.        return 1;
  465.    }
  466.    status = clReleaseMemObject(outputBuffer);
  467.    if(status != CL_SUCCESS)
  468.    {
  469.        std::cout<<"Error: In clReleaseMemObject (outputBuffer)\n";
  470.        return 1;
  471.    }
  472.    status = clReleaseCommandQueue(commandQueue);
  473.    if(status != CL_SUCCESS)
  474.    {
  475.        std::cout<<"Error: In clReleaseCommandQueue\n";
  476.        return 1;
  477.    }
  478.    status = clReleaseContext(context);
  479.    if(status != CL_SUCCESS)
  480.    {
  481.        std::cout<<"Error: In clReleaseContext\n";
  482.        return 1;
  483.    }
  484.  
  485.    return 0;
  486. }
  487.  
  488.  
  489. /*
  490.  * \brief Releases program's resources
  491.  */
  492. void
  493. cleanupHost(void)
  494. {
  495.    if(output != NULL)
  496.    {
  497.        free(output);
  498.        output = NULL;
  499.    }
  500.    if(devices != NULL)
  501.    {
  502.        free(devices);
  503.        devices = NULL;
  504.    }
  505. }
  506.  
  507.  
  508.  
  509. int
  510. main(int argc, char * argv[])
  511. {
  512.    bool GPU = true;
  513.    for(int i = 0; i < 2; i++)
  514.    {
  515.    // Initialize Host application
  516.    if(initializeHost()==1)
  517.        return 1;
  518.  
  519.    // Initialize OpenCL resources
  520.    if(initializeCL(GPU)==1)
  521.    return 1;
  522. /*  char C;
  523.     do
  524.     {
  525.         std::cout << "Use GPU?(Y/N)" << std::endl;
  526.         C = getch();
  527.     }while(!((C == 'Y') || (C == 'y') || (C == 'n') || (C == 'N')));
  528.     if(C == 'Y' || C == 'y')
  529.     {
  530.         if(initializeCL(true)==1)
  531.             return 1;
  532.     }
  533.     else
  534.     {
  535.         if(initializeCL(false)==1)
  536.             return 1;
  537.     }*/
  538.  
  539.    // Run the CL program
  540.    float Clocklast = clock();
  541.    if(runCLKernels()==1)
  542.        return 1;
  543.    float Benchtime = (clock() - Clocklast) / CLOCKS_PER_SEC;
  544.    // Print output array
  545.    //for(int i = 0; i < width; i++) std::cout << output[i] << " ";
  546.    if(GPU) std::cout << "With GPU: "; else std::cout << "With CPU: ";
  547.    std::cout << Benchtime << " Seconds" << std::endl;
  548.        // Releases OpenCL resources
  549.    if(cleanupCL()==1)
  550.        return 1;
  551.  
  552.    // Release host resources
  553.    cleanupHost();
  554.    GPU = false;
  555.    }
  556.    return 0;
  557. }
  558.  
  559.  

Main.hpp:

Código
  1. #include <CL/cl.h>
  2. #include <string.h>
  3. #include <cstdlib>
  4. #include <iostream>
  5. #include <time.h>
  6. #include <fstream>
  7. #include <conio.h>
  8. /*** GLOBALS ***/
  9.  
  10. cl_uint *output;
  11. cl_ulong totalLocalMemory;
  12. cl_ulong usedLocalMemory;
  13. size_t kernelWorkGroupSize;
  14. size_t groupSize;
  15. cl_uint width;
  16.  
  17. /* The memory buffer that is used as input/output for OpenCL kernel */
  18. cl_mem     outputBuffer;
  19.  
  20. cl_context          context;
  21. cl_device_id        *devices;
  22. cl_command_queue    commandQueue;
  23.  
  24. cl_program program;
  25.  
  26. /* This program uses only one kernel and this serves as a handle to it */
  27. cl_kernel  kernel;
  28.  
  29.  
  30. /*** FUNCTION DECLARATIONS ***/
  31. /*
  32.  * OpenCL related initialisations are done here.
  33.  * Context, Device list, Command Queue are set up.
  34.  * Calls are made to set up OpenCL memory buffers that this program uses
  35.  * and to load the programs into memory and get kernel handles.
  36.  */
  37. int initializeCL(bool UseGPU);
  38.  
  39. /*
  40.  *
  41.  */
  42. std::string convertToString(const char * filename);
  43.  
  44. /*
  45.  * This is called once the OpenCL context, memory etc. are set up,
  46.  * the program is loaded into memory and the kernel handles are ready.
  47.  *
  48.  * It sets the values for kernels' arguments and enqueues calls to the kernels
  49.  * on to the command queue and waits till the calls have finished execution.
  50.  *
  51.  * It also gets kernel start and end time if profiling is enabled.
  52.  */
  53. int runCLKernels(void);
  54.  
  55. /* Releases OpenCL resources (Context, Memory etc.) */
  56. int cleanupCL(void);
  57.  
  58. /* Releases program's resources */
  59. void cleanupHost(void);
  60. /*
  61.  * Prints no more than 256 elements of the given array.
  62.  * Prints full array if length is less than 256.
  63.  *
  64.  * Prints Array name followed by elements.
  65.  */
  66. void print1DArray(
  67.         const std::string arrayName,
  68.         const unsigned long * arrayData,
  69.         const unsigned int length);
  70.  

Kernel.cl

Código
  1. __kernel
  2. void Prime(
  3.    __global unsigned int * output)
  4. {
  5. uint tid = get_global_id(0);
  6. output[tid] = 2 * tid;
  7. }
  8.  

El kernel es muy simple, iba a calcular primos, por eso se llama "prime" pero bueno, todavía no me puse a hacerlo.

Un abrazo
APOKLIPTICO


En línea

AMD Phenom II 1075T X6 @ 290 Mhz x 11 (HT 2036 Mhz NB Link 2616 Mhz) 1.23 Vcore
ASUS M4A89GTD-PRO/USB3
2x2gb G-Skill RipjawsX DDR3 1600 Mhz CL7 (7-8-7-24-25-1T)
Seagate 500 Gb
XFX HD4850 512Mb GDDR3. 650 Mhz/995 Mhz 1.1 Tflops.
Littlehorse
All the world's a stage
Moderador
***
Desconectado Desconectado

Mensajes: 2.714


Nie Dam Sie


Ver Perfil WWW
Re: OpenCL + Ati STREAM + CUDA.
« Respuesta #1 en: 22 Septiembre 2010, 17:57 pm »

Hola APOKLIPTICO, necesitas vendor ID o device ID?

Vendor ID: 0x10DE
Device ID: Mediante código

Saludos


En línea

An expert is a man who has made all the mistakes which can be made, in a very narrow field.
Komodo


Desconectado Desconectado

Mensajes: 352



Ver Perfil
Re: OpenCL + Ati STREAM + CUDA.
« Respuesta #2 en: 22 Septiembre 2010, 18:28 pm »

Interesante yo estoy estudiando también cosas sobre la GPU y su uso en programas en C, porque se está poniendo muy de moda..

Yo uso Radeon...

¿Que es CUDA?
En línea


APOKLIPTICO


Desconectado Desconectado

Mensajes: 3.871


Toys in the attic.


Ver Perfil
Re: OpenCL + Ati STREAM + CUDA.
« Respuesta #3 en: 22 Septiembre 2010, 18:32 pm »

Sorry no, me equivoqué, necesito el Platform ID. Para AMD supongo que debe ser "Advanced Micro Devices, Inc.".
Ahi hay un strcmp que comprueba si la plataforma es de AMD, en caso contrario, se va a la CPU si no me equivoco. Si yo pudiese hacer ahi un "or" que incluya el platform ID de Nvidia, sería compatible, en teoría, también con Nvidia.

Interesante yo estoy estudiando también cosas sobre la GPU y su uso en programas en C, porque se está poniendo muy de moda..

Yo uso Radeon...

¿Que es CUDA?

Stream es la tecnología GPGPU (General Purpose Graphics Processing Units) de ATI.
CUDA es la tecnlogía GPGPU de Nvidia.
OpenCL es una tecnología multipropósito para calculo matemático que puede utilizar en teoría ambas plataformas con un mismo código.
En línea

AMD Phenom II 1075T X6 @ 290 Mhz x 11 (HT 2036 Mhz NB Link 2616 Mhz) 1.23 Vcore
ASUS M4A89GTD-PRO/USB3
2x2gb G-Skill RipjawsX DDR3 1600 Mhz CL7 (7-8-7-24-25-1T)
Seagate 500 Gb
XFX HD4850 512Mb GDDR3. 650 Mhz/995 Mhz 1.1 Tflops.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
CUDA/Stream Hash Cracking.
Criptografía
APOKLIPTICO 4 16,356 Último mensaje 25 Octubre 2011, 13:04 pm
por APOKLIPTICO
Compilación estática con OpenCL
Programación C/C++
oPen syLar 2 2,092 Último mensaje 25 Septiembre 2012, 05:10 am
por oPen syLar
[OpenCL] ¿Cómo instalarlo? {Ubuntu 14}
Programación General
GoKGz 2 2,149 Último mensaje 29 Noviembre 2016, 13:27 pm
por GoKGz
Tarea sumar dos matrices CUDA, MATLAB
Programación C/C++
MontSe821 1 3,099 Último mensaje 3 Abril 2020, 13:33 pm
por MAFUS
Khronos Group presenta OpenCL 3.0, ¿qué mejoras integra en gaming?
Noticias
El_Andaluz 0 1,138 Último mensaje 27 Abril 2020, 22:37 pm
por El_Andaluz
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines