3 Replies Latest reply on Aug 11, 2014 2:44 AM by nou

    Compiling Simple Program on Opencl


      Well I am trying to compile a simple program in OpenCl ( i am new to OpenCl)using visual studio 2013, it breaks immediately at clCreateContext command  and error is "Unhandled exception at 0x524E132F (OpenCL.dll) in OpencL Program.exe: 0xC0000005: Access violation reading location 0xCCCCCCCC.' I have configured it again and again , if someone has faced this similar problem please do help me under this thread.

      Thanks !

        • Re: Compiling Simple Program on Opencl

          can you compile and run examples from SDK?

            • Re: Compiling Simple Program on Opencl

              I can just run them , they are already compiled so I usually debug them to know whats happening in the back ground, I just wanna know after configuring visual studio for opencl and amd gpu , why it does not work ?

              In a separate Project! Below is the code !

              int main(int argc, char **argv){


              cl_platform_id platform;

              cl_device_id device;

              cl_context context;

              cl_program program;

              cl_kernel kernel;

              cl_command_queue queue;

              cl_mem kernelBuffer;


              FILE* programHandle;

              char *programBuffer;

              char *programLog;

              size_t programSize;

              char hostBuffer[32];


              clGetPlatformIDs(1, &platform, NULL);

              clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL);


              context= clCreateContext(NULL, 1, &device, NULL, NULL, NULL); // This bold line throws unhandled exception saying that memory access violation , as mention in the Question and the program breaks!

              Well by the way i m running this code in Visual Studio 2013, Windows 8, 64 bit , Amd Raedon 6770,

              And i configured the visual sudio project settings following some tutorial on a website ! Thanks for the response !