Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: I don't know this error.

  1. #1

    I don't know this error.

    Hello, I'm an OpenCL beginner.

    I'd like to develop of hextile algorithm.
    I studied sample source, article, and another comment.
    But I don't know why are they occur error!!
    I'm very stressed out, because this problem occured last week.

    Please, help me to solve this problem.


    Error message is...
    • ERROR : Failed to build program executable!
      ptxas ptx input, line 59; fatal : Parsing error near ';': syntax error
      : Retrieving binary for 'anonymous_jit_identity', for gpu='sm_12', usage mode='

  2. #2

    Re: I don't know this error.

    There seems to be some kind of syntax error in your kernel code. We could have a look at it if you post it.

  3. #3

    Re: I don't know this error.

    source code is that...

    Code :
    __kernel __attribute__((vec_type_hint(int)))
    void mysubrectEncode(
    					__global int* destoffset,	// out data
    					__global ulong *dest,	// out data
    					__global ulong *subrectData,// in data
    					const int w, 
    					const int h, 
    					ulong bg,  
    					int mono) 	
    {
    	int yH = get_group_id(0);	
    	int xW = get_local_id(1);
    	int addr = yH*w;
     
    	ulong cl;
    	int i,j;
    	int hx = 0, vx = 0, hy, vy;
    	int hyflag;
    	int hw,hh,vw,vh;
    	int thex, they, thew, theh;
    	int numsubs = 0;
    	int newLen;
    	int rectoffset;
     
    	__global ulong4 *line;
    	__global ulong4 *seg;
    destoffset = 0;
    	rectoffset = *destoffset;
    	*destoffset += 1;
     
    	line = (subrectData + (yH*w));
     
    			if(bg != (ulong)(line+xW))
    			{
    				cl = (ulong)line+xW;
    				hy = yH-1;
    				hyflag = 1;
     
    				for(j=yH; j<h; j++)
    				{
    BREAK:					
    					seg = (__global ulong4 *)(subrectData + (j*w));	
     
    					if(cl != (ulong)(seg + xW))
    					{ 
    						goto BREAK;
    						//break;
    					}
    					i = xW;
     
    					while((cl == (ulong)(seg+i)) && (i<w))
    						i += 1;
     
    					i -= 1;
     
     
    					if(j==yH)
    						vx = hx = i;
    					if(i<vx)
    						vx = i;
     
    					if((hyflag > 0) && (i >= hx))
    					{
    						hy += 1;
    					}
    					else
    					{
    						hyflag = 0;
    					}
    				}
    ........
    }

  4. #4

    Re: I don't know this error.

    I don't know..why syntax error..

  5. #5

    Re: I don't know this error.

    I could not find any misplaced ',' near line 59, which was what the error message hinted at. I have never tried using gotos in kernel code, try replacing it with a 'continue;'

  6. #6

    Re: I don't know this error.

    Quote Originally Posted by ibbles
    I could not find any misplaced ',' near line 59, which was what the error message hinted at. I have never tried using gotos in kernel code, try replacing it with a 'continue;'

    I could not find any misplace, too.
    This line is changed, and then execute build.
    After a moment, the error message is continue...
    (error line is not changed any-number... )

    Someone said, you aren't control the memory pointer.. or pointer conversions problem.

    But I don't know why occur this error message.

    I used global memory space, the other space is not used..Because at the part of memory is division each others.(I think that..)

    I'm very sad.. -_?

  7. #7
    Senior Member
    Join Date
    Nov 2009
    Posts
    118

    Re: I don't know this error.

    What is your OpenCL platform and how do you compiile this kernel?

  8. #8

    Re: I don't know this error.

    Quote Originally Posted by matrem
    What is your OpenCL platform and how do you compiile this kernel?

    I compile this kernel code is that..
    Code :
    shrLog(LOGBOTH, 0.0, "Initializing OpenCL\n");
    		oclHandles.context = clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, &err);
    		shrCheckError(err, CL_SUCCESS);
     
    		err = clGetContextInfo(oclHandles.context, CL_CONTEXT_DEVICES, 0, NULL, &dataByte);
    		oclHandles.devices = (cl_device_id*)malloc(dataByte);
     
    		err |= clGetContextInfo(oclHandles.context, CL_CONTEXT_DEVICES, dataByte, oclHandles.devices, NULL);
    		shrCheckError(err, CL_SUCCESS);
     
    		GetAndLogDevice(oclHandles.devices, argc, &argv, &oclHandles.context);	// print device data
     
    		//Create a command-queue
    		oclHandles.queue = clCreateCommandQueue(oclHandles.context, oclHandles.devices[0], 0, &err);
    		shrCheckError(err, CL_SUCCESS);
     
    		// device Info
    		size_t returned_size = 0;
    		size_t max_workgroup_size = 0;
    		err = clGetDeviceInfo(*oclHandles.devices, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(size_t), &max_workgroup_size, &returned_size);
    		if (err != CL_SUCCESS)
    		{
    			printf("Error: Failed to retrieve device info!\n");
    			return EXIT_FAILURE;
    		}
    // 3. allocating inputCL buffer..
    	shrLog(LOGBOTH, 0.0, "...allocating inputCL buffers\n");
     
     
    		// if you use CL_MEM_COPY_HOST_PTR attibute, you must write 4 parameter(void*) data.
    		// Another attribute - you choose that 4 parameter write or NULL.
    		clBuffers.inputCL = clCreateBuffer(oclHandles.context, CL_MEM_READ_WRITE, compressedSize, NULL, &err);
    		if(!clBuffers.inputCL)
    		{
    			printf("ERROR : Failed to allocating inputCL buffer!\n");
    			return EXIT_FAILURE;
    		}
    		// Hextile ??? ?? ?? raw ??? ? ??? ??? size? image? ???? ??
    		clBuffers.outputCL = clCreateBuffer(oclHandles.context, CL_MEM_WRITE_ONLY, compressedSize, NULL, &err);
    		if(!clBuffers.outputCL)
    		{
    			printf("ERROR : Failed to allocating OutputCL buffer!\n");
    			return EXIT_FAILURE;
    		}
    //4. Program Setup
    	//
    	shrLog(LOGBOTH, 0.0, "Initializing OpenCL Hextile...\n");
    		// 		ret = InitOpenCL(clGPUContext, clCommandQueue, argv);
    		size_t program_length;
    		cl_device_id device_id;
     
    		// kernel.cl loading
    		shrLog(LOGBOTH, 0.0, "..loading Kernel.cl\n");
    		char* source_path = shrFindFilePath("SubRectEncode.cl", argv[0]);
    		shrCheckError(source_path != NULL, shrTRUE);
    //		const char* filename = "SubRectEncode.cl";
    //		char *source_path = load_program_source(filename);
     
    		char *kernel_source = oclLoadProgSource(source_path, "", &program_length);
    		//shrCheckError(kernel_source != NULL, shrTRUE);
     
    		// Connect to a GPU computing device
    		err = clGetDeviceIDs(NULL, CL_DEVICE_TYPE_GPU, 1, &device_id, NULL);
    		if(err != CL_SUCCESS)
    		{
    			printf("ERROR : Failed to create a device group!\n");
    			return EXIT_FAILURE;
    		}
     
    		// create kernel program
    		shrLog(LOGBOTH, 0.0, "..creating kernel program\n");
    		oclHandles.program = clCreateProgramWithSource(oclHandles.context, 1, (const char **)&kernel_source, &program_length, &err);
    		if(!oclHandles.program || err != CL_SUCCESS)
    		{
    			printf("ERROR : Failed to create computing program!!\n");
    			return EXIT_FAILURE;
    		}
     
     
    		// build kernel program
    		shrLog(LOGBOTH, 0.0, "...building kernel program\n");
     
    		err = clBuildProgram(oclHandles.program, 0, NULL, NULL, NULL, NULL); // this erro!
    		if(err != CL_SUCCESS)
    		{
    			size_t len;
    			char buffer[4096];
     
    			printf("ERROR : Failed to build program executable!\n");
    			clGetProgramBuildInfo(oclHandles.program, device_id, CL_PROGRAM_BUILD_LOG, 
    				sizeof(buffer), buffer, &len);
    			printf("%s\n", buffer);
    			return EXIT_FAILURE;
    		}

    I write the error statement up to the code.

    Oh, I have one question..
    The sample source code at NVIDIA are not include the clGetDeviceIDs() function.
    But another sample at web-stie is included the clGetDeviceIDs() function.
    Is it important to me??

  9. #9

    Re: I don't know this error.

    please, advise to me.

    I don't know why is error.

  10. #10
    Junior Member
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    21

    Re: I don't know this error.

    ptxas ptx input, line 59; fatal : Parsing error near ';': syntax error

    is the error. You could try to comment out the line 59 (and related) to see, if this "solve" the error.
    When I count correctly, there is the problem :
    Code :
                   if(j==yH)
                      vx = hx = i;

    If so, try to use
    Code :
                   if(j==yH)
                   {
                      vx = i;
                      hx = i;
                    }

Page 1 of 2 12 LastLast

Similar Threads

  1. why donīt i need uNormalMatrix?
    By Friba77 in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 05-29-2012, 12:28 AM
  2. Replies: 5
    Last Post: 02-05-2011, 09:47 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
  •