Changes between Version 20 and Version 21 of OpenCLTransformation


Ignore:
Timestamp:
08/21/14 14:19:41 (12 years ago)
Author:
fuufusuu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OpenCLTransformation

    v20 v21  
    22* 'args' : a struct containing all of the variables that will be passed into a kernel. Uses an array of void pointers. Size determined by number of parameters. Has an array of ints as a flag for whether a method used malloc or not, used in clReleaseKernel
    33{{{
     4#!c
    45typedef struct
    56{
     
    1213
    1314{{{
     15#!c
    1416typedef struct
    1517{
     
    2729Currently, this method
    2830{{{
     31#!c
    2932err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &input);
    3033}}}
     
    3841* 'Group' : Each workgroup shares the same data. Currently unimplemented.
    3942{{{
     43#!c
    4044  ((args*)kernel.arguments)->input = input;
    4145  //global
     
    5155
    5256{{{
     57#!c
    5358void __kernel foo( __qualifier type bar, ...){}
    5459}}}
     
    6570
    6671Memory fences and barriers can be used to control threads on the thread or workgroup level.
     72Note that data across workgroups are generally not shared except when using global memory.
    6773
    6874Any method with cl_bool blocking_read in the parameter can be used to determine if the host can run work in parallel or sequentially across different devices.
     
    7480
    7581{{{
     82#!c
    7683cl_kernel clCreateKernel(args * argument, char * function)
    7784{
     
    9299
    93100{{{
     101#!c
    94102void clReleaseKernel(cl_kernel kernel)
    95103{
     
    110118clCreateBuffer creates a buffer object with certain types of information attached to it. In the .cvl it only uses the right side with the third parameter, and mallocs space for it
    111119{{{
     120#!c
    112121input = (int *) malloc(sizeof(int) * count);
    113122}}}
     
    117126clEnqueueWriteBuffer writes to a buffer with extra data. In the transformation it is currently a memcpy.
    118127{{{
     128#!c
    119129memcpy(input, data, sizeof(int) * count);
    120130}}}
     
    125135In regular openCL this will ask the device what work group size to use at runtime. This is not used in the transformation, instead it will make an input for the local workgroup size.
    126136{{{
     137#!c
    127138$input int LOCAL;
    128139}}}
     
    133144
    134145{{{
     146#!c
    135147  int clEnqueueNDRangeKernel(cl_command_queue commands, cl_kernel kernel, int global, int local)
    136148{
     
    158170
    159171{{{
     172#!c
    160173void worksquare(size_t local, size_t global, kernel param)
    161174{
     
    174187
    175188{{{
     189#!c
    176190  memcpy(results, output, sizeof(int) * count);
    177191}}}