Results 1 to 3 of 3

Thread: Question about protecting ocl code

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    5

    Question about protecting ocl code

    Hello.

    I want to know if there is any variable which works the same than __CUDACC__ in cuda.

    Aka this, but in OCL
    #ifdef __CUDACC__
    __device__ void initialize_cuda_kernel(float *zz, int sal)
    {
    zz[0] = sal;
    }
    #endif

    I want to have a file which makes nothing (so gcc doesnt complain) when including it on a normal c file, but works fine when compiling via clBuildProgram calls.

    Thanks,

  2. #2

    Re: Question about protecting ocl code

    Try to check if __OPENCL_VERSION__ is defined

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    5

    Re: Question about protecting ocl code

    Thanks =), it works fine.

Similar Threads

  1. Runtime failed to load kernels from OCL binary
    By luizdrumond in forum OpenCL
    Replies: 0
    Last Post: 10-01-2012, 09:13 AM
  2. OCL programm without *.cl file
    By BratSinot in forum OpenCL
    Replies: 7
    Last Post: 09-12-2011, 08:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •