9 Replies Latest reply on Feb 18, 2010 1:48 AM by mosix0
      • AMD's new release of ATI Stream SDK v2.0 w/ OpenCL(tm) 1.0
        mosix0

        I just downloaded SDK 2.0 (64-bit Linux) and upgraded from "beta4", but it has a bug that breaks my program.

        The bug is:

         

        cl_mem invalid_memory_object = (cl_mem)(-1);

        error = clSetKernelArg(kernel, argnum, sizeof(cl_mem), &invalid_memory_object);

         

        The OpenCL standard specifies that an error of "CL_INVALID_MEM_OBJECT" must be returned, which is so in "beta4", but after the upgrade, no error is returned (CL_SUCCESS).

         

        Sorry, but my program cannot work without this feature.  Is there any chance of fixing it?

         

        BTW, I encountered several other bugs (which are not as critical as this one): where is the best place to report them?

          • AMD's new release of ATI Stream SDK v2.0 w/ OpenCL(tm) 1.0
            genaganna

            Mosix0,

                      We will report this to developers.  I don't really understand how it blocks your code.  Please post in this forum as a separate post if you encounter any problems/bugs.

              • AMD's new release of ATI Stream SDK v2.0 w/ OpenCL(tm) 1.0
                genaganna

                Mosix0,

                           Could you please post testcase here to reproduce your problem?

                  • AMD's new release of ATI Stream SDK v2.0 w/ OpenCL(tm) 1.0
                    mosix0

                    Well, here is the most minimal program to test this issue:


                    #include <cl.h>
                    #include <stdlib.h>
                    #include <stdio.h>

                    char *src = "__kernel void add(__global int *A, __global int *B, __global int *C, int n){int i = get_global_id(0);C = A + B;}";

                    int
                    main(na, argv)
                    char *argv[];
                    {
                    cl_platform_id platform;
                    cl_context_properties cps[3];
                    static cl_context context;
                    cl_program program;
                    cl_kernel kernel;
                    cl_mem invalid_mem_object = (cl_mem)(-1);
                    cl_int result;

                    if(clGetPlatformIDs(1, &platform, NULL) != CL_SUCCESS)
                    {
                    fprintf(stderr, "Could not get a platform\n");
                    exit(1);
                    }
                    cps[0] = CL_CONTEXT_PLATFORM;
                    cps[1] = (cl_context_properties)platform;
                    cps[2] = 0;
                    if(!(context = clCreateContextFromType(cps, CL_DEVICE_TYPE_ALL,
                    NULL, NULL, NULL)))
                    {
                    fprintf(stderr, "No context\n");
                    exit(1);
                    }
                    if(!(program = clCreateProgramWithSource(context, 1,
                    (const char **)&src, NULL, NULL)))
                    {
                    fprintf(stderr, "No program\n");
                    exit(1);
                    }
                    if(clBuildProgram(program, 0, NULL, "", NULL, NULL) != CL_SUCCESS)
                    {
                    printf("Program not built\n");
                    exit(1);
                    }
                    if(!(kernel = clCreateKernel(program, "add", NULL)))
                    {
                    fprintf(stderr, "No kernel\n");
                    exit(1);
                    }
                    result = clSetKernelArg(kernel, 0, sizeof(cl_mem), &invalid_mem_object);
                    if(result == CL_INVALID_MEM_OBJECT)
                    printf("Correct!\n");
                    else
                    printf("Wrong - got error %d\n", result);
                    exit(0);
                    }