- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I stumbled over a weird behavior that I cannot explain:
[cpp]
size_t global_work_sizes[2] = {1, 1};
ret = clEnqueueNDRangeKernel(command_queue, kernel, 2, NULL, global_work_sizes, NULL, 0, NULL, NULL); CHECK(ret);
[/cpp]
[cpp]
__kernel void foo() {
printf("global id %u\n", get_global_id(0));
// returns global id 0
printf("global size %u\n", get_global_size(0));
// returns global size 1
printf("global id: %u global size: %u\n", get_global_id(0), get_global_size(0));
// returns global id: 0 global size: 0 - why is get_global_size(0) = 0?
printf("global id: %u global size: %u unused var: %u\n", get_global_id(0), get_global_size(0));
// returns global id: 0 global size: 0 unused var: 1 - where does that 1 come from?
printf("%u %u\n", 0, 1);
// return 0 1 - that is what I would be expecting
}
[/cpp]
Am I missing something here?
Cheers,
Markus
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(The forum killed my newline escape character - of course I mean %u[backslash]n instead of %un)
Versions:
[bash]
[@memphis:~] $ cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 2
[@memphis:~] $ uname -a
Linux memphis 3.0.13-0.27-default #1 SMP Wed Feb 15 13:33:49 UTC 2012 (d73692b) x86_64 x86_64 x86_64 GNU/Linux
[@memphis:~] 1 $ rpm -qa |grep intel
intel-mic-2.1.6720-15.suse
intel-mic-mpm-2.1.6720-15.suse
opencl-1.2-intel-mic-3.0.67279-1
intel-mic-sysmgmt-2.1.6720-15.suse
intel-mic-kmod-2.1.6720-15.3.0.13.0.suse
intel-mic-gdb-2.1.6720-15.suse
intel-mic-flash-2.1.386-3.suse
intel-mic-cdt-2.1.6720-15.suse
opencl-1.2-intel-devel-3.0.67279-1
intel-mic-micmgmt-2.1.6720-15.3.0.13.0.suse
opencl-1.2-intel-cpu-3.0.67279-1
intel-mic-gpl-2.1.6720-15.suse
intel-mic-crashmgr-2.1.6720-15.suse
[/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yuri,
Thank you for looking into it. Your explanation makes perfect sense. I never ran into %u returning wrong results, so I made a wrong assumption here.
Best,
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I had the same problem, but the %zu was the solution.
Thanks for this post. Saved my day!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page