• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OpenCL Basic Programming Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenCL Basic Programming Question


  • Subject: Re: OpenCL Basic Programming Question
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sat, 15 Feb 2014 16:07:02 +0700

On 15 Feb 2014, at 15:51, Uli Kusterer <email@hidden> wrote:

> On 14 Feb 2014, at 15:53, Gerriet M. Denkmann <email@hidden> wrote:
>> I am trying to build the Basic Programming Sample in: <https://developer.apple.com/library/mac/documentation/Performance/Conceptual/OpenCL_MacProgGuide/ExampleHelloWorld/Example_HelloWorld.html#//apple_ref/doc/uid/TP40008312-CH112-SW2>
>>
>> I have myKernel.cl:
>>
>> __kernel void squareq(  __global float* input, __global float* output )
>> {
>> 	int i = get_global_id(0);
>> 	printf("i %d\n",i);			//	never seen
>> 	output[i] = input[i] * input[i];
>> }
>>
>> and myKernel.cl.h:
>
> What happens when you remove the printf call ? AFAIK CIKernels don’t run with a full runtime. They’re intended for raw number crunching. So I wouldn’t be surprised if it crashed beause it can’t resolve printf to anything that it can actually run on the GPU.

I created a kernel without anything, without any arguments even; tried CPU and GPU: always the same:

squarea_kernel( &range, mem_in, mem_out );  ---> crash

thread #1: tid = 0xb149e, 0x0000000100003cd8 HalloCL`squarea_kernel,
		queue = 'opencl_runtime, stop reason = EXC_BAD_ACCESS (code=2, address=0x100003cd8)
frame #0: 0x0000000100003cd8 HalloCL`squarea_kernel
frame #1: 0x00000001000015f5 HalloCL`__49-[HaCLAppDelegate applicationDidFinishLaunching:]
		_block_invoke(.block_descriptor=<unavailable>) + 213 at HaCLAppDelegate.m:120
frame #2: 0x00007fff9003c2ad libdispatch.dylib`_dispatch_client_callout + 8
frame #3: 0x00007fff9003d166 libdispatch.dylib`_dispatch_barrier_sync_f_invoke + 39
frame #4: 0x0000000100001499 HalloCL`-[HaCLAppDelegate applicationDidFinishLaunching:]
	(self=0x000061800001df90, _cmd=0x00007fff8eb36274, aNotification=0x000060000024cea0) + 809
	at HaCLAppDelegate.m:86

That is, the EXC_BAD_ACCESS seems to be the start address of my kernel.


By the way:  what does EXC_BAD_ACCESS code = 1 or 2 mean? I cannot find any info for this.


Kind regards,

Gerriet.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >OpenCL Basic Programming Question (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: OpenCL Basic Programming Question (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: OpenCL Basic Programming Question
  • Next by Date: Hooking up Help menu item
  • Previous by thread: Re: OpenCL Basic Programming Question
  • Next by thread: Re: OpenCL Basic Programming Question
  • Index(es):
    • Date
    • Thread