<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SOLVED IT in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131029#M5719</link>
    <description>&lt;P&gt;SOLVED IT&lt;/P&gt;

&lt;P&gt;CPU SKU:&amp;nbsp;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: small;"&gt;model name&lt;/SPAN&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: small; white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: small;"&gt;: Intel(R) Xeon(R) CPU E31270 @ 3.40GHz&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Same problem:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Using OpenCL via cpu:Name Intel(R) OpenCL:VSN: OpenCL 1.2 LINUX&lt;BR /&gt;
	***Runtime error: reached an uninitialized image function***&lt;BR /&gt;
	***Runtime error: reached an uninitialized image function***&lt;BR /&gt;
	...&lt;SPAN style="font-size: 1em;"&gt;Trace/breakpoint trap (core dumped)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 1em;"&gt;(gdb) bt&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;#0  0x00007f68decf13c5 in trap_function ()
#1  0x00007f68decff18e in rgba_to_normal ()
#2  0x00007f6839b0085f in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libOclCpuBackEnd.so
#3  0x00007f68416d8cd9 in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libcpu_device.so
#4  0x00007f6841e0b6aa in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libtask_executor.so
#5  0x00007f6841e0c439 in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libtask_executor.so
#6  0x00007f6841e0c7d9 in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libtask_executor.so
#7  0x00007f6841a97b40 in tbb::internal::custom_scheduler&amp;lt;tbb::internal::IntelSchedulerTraits&amp;gt;::local_wait_for_all (this=0x7f683aef3e00, parent=..., child=0x0) at ../../src/tbb/custom_scheduler.h:447
#8  0x00007f6841a93f09 in tbb::internal::arena::process (this=0x7f682bbfd510, s=...) at ../../src/tbb/arena.cpp:98
#9  0x00007f6841a924c5 in tbb::internal::market::process (this=0x7f682bbfd510, j=...) at ../../src/tbb/market.cpp:471
#10 0x00007f6841a8e5d4 in tbb::internal::rml::private_worker::run (this=0x7f682bbfd510) at ../../src/tbb/private_server.cpp:275
#11 0x00007f6841a8e506 in tbb::internal::rml::private_worker::thread_routine (arg=0x7f682bbfd510) at ../../src/tbb/private_server.cpp:232
#12 0x00007f6947e8f6ba in start_thread (arg=0x7f682bbfe700) at pthread_create.c:333
#13 0x00007f69479bd41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Finding that it didn't work for 1.2 either caused me to do some rubber ducking with a friend and found that using:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;const sampler_t sampler=CLK_NORMALIZED_COORDS_FALSE|CLK_ADDRESS_REPEAT;&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;is undefined behavior so fixed that to:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;const sampler_t sampler=CLK_NORMALIZED_COORDS_FALSE|CLK_ADDRESS_CLAMP|CLK_FILTER_LINEAR;
&lt;/PRE&gt;

&lt;P&gt;And problem solved, so your CPU drivers are a bit picky, but my code was clearly breaking the spec.&lt;/P&gt;

&lt;P&gt;Super thanks for the help!!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 07:49:32 GMT</pubDate>
    <dc:creator>gudmundsson__dan</dc:creator>
    <dc:date>2018-09-21T07:49:32Z</dc:date>
    <item>
      <title>[SOLVED]  ***Runtime error: reached an uninitialized image function***</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131025#M5715</link>
      <description>&lt;P&gt;Installed&amp;nbsp;intel_sdk_for_opencl_2017_7.0.0.2568_x64/ for testing my kernels with CPU (and 2.1) and I got the error in the topic.&lt;/P&gt;

&lt;P&gt;I must be doing something wrong but I can't figure it out, before reaching the kernel in the backtrace I run other more complex kernels which uses read_imagef(...).&lt;/P&gt;

&lt;P&gt;The code works fine with intel-gpu (1.2) driver and Nvidia-gpu (1.2?) drivers.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;Trying to make debug info (-g -s &amp;lt;SRC&amp;gt;) available, causes seq-faults in earlier kernels (probably me failing to use gdb in the correct way), I don't get any debug symbols in that crash either.&lt;/P&gt;

&lt;P&gt;The complete file is here &lt;A href="https://github.com/dgud/wings/blob/master/shaders/img_lib.cl"&gt;https://github.com/dgud/wings/blob/master/shaders/img_lib.cl&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;__kernel void rgba_to_normal(__read_only image2d_t inImg, const int w, const int h, __global float4 *outImg)&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;{&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;const sampler_t sampler=CLK_NORMALIZED_COORDS_FALSE|CLK_ADDRESS_REPEAT;&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;int x = (int) get_global_id(0);&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;int y = (int) get_global_id(1);&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;if(x &amp;lt; w &amp;amp;&amp;amp; y &amp;lt; h) {&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;float4 cx0 = read_imagef(inImg, sampler, (float2)(x, y));&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;outImg[y*w+x] = cx0*2.0f-1.0f;&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;}&lt;/SPAN&gt;&lt;BR style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;" /&gt;
	&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; white-space: pre;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;(gdb) bt&lt;BR /&gt;
	#0&amp;nbsp; 0x00007f77761ba6e1 in trap_function ()&lt;BR /&gt;
	#1&amp;nbsp; 0x00007f7824e5dff7 in rgba_to_normal ()&lt;BR /&gt;
	#2&amp;nbsp; 0x00007f7756b35dd9 in ?? () from /opt/intel/opencl/exp-runtime-2.1/lib64/libOclCpuBackEnd.so&lt;BR /&gt;
	#3&amp;nbsp; 0x00007f775f125559 in ?? () from /opt/intel/opencl/exp-runtime-2.1/lib64/libcpu_device_2_1.so&lt;BR /&gt;
	#4&amp;nbsp; 0x00007f775fa60c8a in ?? () from /opt/intel/opencl/exp-runtime-2.1/lib64/libtask_executor_2_1.so&lt;BR /&gt;
	#5&amp;nbsp; 0x00007f775fa62280 in ?? () from /opt/intel/opencl/exp-runtime-2.1/lib64/libtask_executor_2_1.so&lt;BR /&gt;
	#6&amp;nbsp; 0x00007f775fa62589 in ?? () from /opt/intel/opencl/exp-runtime-2.1/lib64/libtask_executor_2_1.so&lt;BR /&gt;
	#7&amp;nbsp; 0x00007f775f5eb0c5 in tbb::internal::custom_scheduler&amp;lt;tbb::internal::IntelSchedulerTraits&amp;gt;::local_wait_for_all (this=0x7f775d3b3e80, parent=..., child=0x0) at ../../src/tbb/custom_scheduler.h:474&lt;BR /&gt;
	#8&amp;nbsp; 0x00007f775f5e68f2 in tbb::internal::arena::process (this=0x7f7755577510, s=...) at ../../src/tbb/arena.cpp:96&lt;BR /&gt;
	#9&amp;nbsp; 0x00007f775f5e4c48 in tbb::internal::market::process (this=0x7f7755577510, j=...) at ../../src/tbb/market.cpp:495&lt;BR /&gt;
	#10 0x00007f775f5e0949 in tbb::internal::rml::private_server::remove_server_ref (this=&amp;lt;optimized out&amp;gt;, $`6=&amp;lt;optimized out&amp;gt;) at ../../src/tbb/private_server.cpp:275&lt;BR /&gt;
	#11 tbb::internal::rml::private_server::request_close_connection (this=0x7f7755577510) at ../../src/tbb/private_server.cpp:192&lt;BR /&gt;
	#12 0x00007f775f5e08d6 in tbb::internal::rml::private_worker::thread_routine (arg=0x7f7755577510) at ../../src/tbb/private_server.cpp:228&lt;BR /&gt;
	#13 0x00007f7869fa66ba in start_thread (arg=0x7f7755578700) at pthread_create.c:333&lt;BR /&gt;
	#14 0x00007f7869ad441d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 08:51:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131025#M5715</guid>
      <dc:creator>gudmundsson__dan</dc:creator>
      <dc:date>2018-09-18T08:51:14Z</dc:date>
    </item>
    <item>
      <title>Hi DanG,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131026#M5716</link>
      <description>&lt;P&gt;Hi DanG,&lt;/P&gt;

&lt;P&gt;Can you try the production CPU runtime 16.1.2 instead of the experimental runtime included with the SDK?&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&lt;A href="https://software.intel.com/en-us/articles/opencl-drivers" target="_blank"&gt;https://software.intel.com/en-us/articles/opencl-drivers&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
	&lt;LI&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&lt;A href="https://software.intel.com/en-us/articles/opencl-drivers#cpu-section" target="_blank"&gt;https://software.intel.com/en-us/articles/opencl-drivers#cpu-section&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Also, please can you ensure there isn't any deprecated OpenCL API 1.2 calls in the host side source if the kernel and implementation is built for 2.0 or 2.1? Ensure build options match? ex: -cl-std&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;&lt;A href="https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/clBuildProgram.html" target="_blank"&gt;https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/clBuildProgram.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I'm assuming intel-gpu is beignet... can you share the CPU SKU on which you're executing?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 17:23:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131026#M5716</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2018-09-20T17:23:30Z</dc:date>
    </item>
    <item>
      <title>Thanks for the feedback, your</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131027#M5717</link>
      <description>&lt;P&gt;Thanks for the feedback, your answer will require that I experiment a bit, so it might take a while to get back to you.&lt;/P&gt;

&lt;P&gt;Since I use erlang as programming language I use an OpenCL wrapper that tries to hide the version differences, so mixing version api calls is definitely a possibility. And 2.0 and 2.1 is rather untested paths for me.. cough nvidia cough.&lt;/P&gt;

&lt;P&gt;But if I disable the two trivial kernels that causes the crashes, the other more complex kernels work fine (also uses image functionality), and the others are needed and the two that crashed was just for optimizations, so I'm happy :-)&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;"I'm assuming intel-gpu is beignet..." ??&amp;nbsp; does not compute (English is not my 1st language and googling beignet links to fried pastry)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;I have the Linux machine at work so can't check CPU SKU right now, best guess&amp;nbsp; ~2012 Xeon 4c with 4 HT.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:05:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131027#M5717</guid>
      <dc:creator>gudmundsson__dan</dc:creator>
      <dc:date>2018-09-20T18:05:47Z</dc:date>
    </item>
    <item>
      <title>DanG,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131028#M5718</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;DanG,&lt;/SPAN&gt;&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;No worries. Please give the production CPU runtime a try. Would love to hear feedback about your success or even a stack trace if the issue still persists there. It could be a productive filing.&lt;/LI&gt;
	&lt;LI&gt;If there is some sort of 1.2 issue that doesn't work because the implementation is 2.x that&amp;nbsp; could be a useful filing too.&lt;/LI&gt;
	&lt;LI&gt;Hopefully, the production CPU runtime instead of the experimental is a satisfactory resolution.&lt;/LI&gt;
	&lt;LI&gt;Sidebar: Sorry for the communication mixup... '&lt;SPAN style="font-size: 1em;"&gt;beignet' happens to also be the name of an opencl implementation distributed for Intel processors prior to 6th gen Intel Core processors. My assumption is that if you pulled a package from the system package manager called intel-gpu, it was beignet. Some of the context is that beignet contributions from Intel were stopped infavor of Intel Graphics Compute Runtime for OpenCL Applications a.k.a. 'neo'. Our primary support targets are thus associated with the newer implementation.&lt;/SPAN&gt;
		&lt;UL&gt;
			&lt;LI&gt;&lt;SPAN style="font-size: 1em;"&gt;Yes, it is also a pastry.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;/UL&gt;
	&lt;/LI&gt;
	&lt;LI&gt;&lt;SPAN style="font-size: 1em;"&gt;Worth mentioning... the CPU implementations are backed by TBB... and some users have seen odd issues when mixing their already TBB application with the CPU runtimes which use TBB... particularly when using TBB configuration or runtime control parameters.&lt;/SPAN&gt;
		&lt;UL&gt;
			&lt;LI&gt;&lt;SPAN style="font-size: 1em;"&gt;​If you are using TBB it could be useful to know how.&lt;/SPAN&gt;&lt;/LI&gt;
			&lt;LI&gt;&lt;SPAN style="font-size: 1em;"&gt;We have some TBB usage safety mitigations in the upcoming release of the production CPU runtime.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;/UL&gt;
	&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;-MichaelC&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 21:04:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131028#M5718</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2018-09-20T21:04:05Z</dc:date>
    </item>
    <item>
      <title>SOLVED IT</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131029#M5719</link>
      <description>&lt;P&gt;SOLVED IT&lt;/P&gt;

&lt;P&gt;CPU SKU:&amp;nbsp;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: small;"&gt;model name&lt;/SPAN&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: small; white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: small;"&gt;: Intel(R) Xeon(R) CPU E31270 @ 3.40GHz&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Same problem:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Using OpenCL via cpu:Name Intel(R) OpenCL:VSN: OpenCL 1.2 LINUX&lt;BR /&gt;
	***Runtime error: reached an uninitialized image function***&lt;BR /&gt;
	***Runtime error: reached an uninitialized image function***&lt;BR /&gt;
	...&lt;SPAN style="font-size: 1em;"&gt;Trace/breakpoint trap (core dumped)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 1em;"&gt;(gdb) bt&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;#0  0x00007f68decf13c5 in trap_function ()
#1  0x00007f68decff18e in rgba_to_normal ()
#2  0x00007f6839b0085f in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libOclCpuBackEnd.so
#3  0x00007f68416d8cd9 in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libcpu_device.so
#4  0x00007f6841e0b6aa in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libtask_executor.so
#5  0x00007f6841e0c439 in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libtask_executor.so
#6  0x00007f6841e0c7d9 in ?? () from /opt/intel/opencl-1.2-6.4.0.37/lib64/libtask_executor.so
#7  0x00007f6841a97b40 in tbb::internal::custom_scheduler&amp;lt;tbb::internal::IntelSchedulerTraits&amp;gt;::local_wait_for_all (this=0x7f683aef3e00, parent=..., child=0x0) at ../../src/tbb/custom_scheduler.h:447
#8  0x00007f6841a93f09 in tbb::internal::arena::process (this=0x7f682bbfd510, s=...) at ../../src/tbb/arena.cpp:98
#9  0x00007f6841a924c5 in tbb::internal::market::process (this=0x7f682bbfd510, j=...) at ../../src/tbb/market.cpp:471
#10 0x00007f6841a8e5d4 in tbb::internal::rml::private_worker::run (this=0x7f682bbfd510) at ../../src/tbb/private_server.cpp:275
#11 0x00007f6841a8e506 in tbb::internal::rml::private_worker::thread_routine (arg=0x7f682bbfd510) at ../../src/tbb/private_server.cpp:232
#12 0x00007f6947e8f6ba in start_thread (arg=0x7f682bbfe700) at pthread_create.c:333
#13 0x00007f69479bd41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Finding that it didn't work for 1.2 either caused me to do some rubber ducking with a friend and found that using:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;const sampler_t sampler=CLK_NORMALIZED_COORDS_FALSE|CLK_ADDRESS_REPEAT;&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;is undefined behavior so fixed that to:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;const sampler_t sampler=CLK_NORMALIZED_COORDS_FALSE|CLK_ADDRESS_CLAMP|CLK_FILTER_LINEAR;
&lt;/PRE&gt;

&lt;P&gt;And problem solved, so your CPU drivers are a bit picky, but my code was clearly breaking the spec.&lt;/P&gt;

&lt;P&gt;Super thanks for the help!!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 07:49:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/SOLVED-Runtime-error-reached-an-uninitialized-image-function/m-p/1131029#M5719</guid>
      <dc:creator>gudmundsson__dan</dc:creator>
      <dc:date>2018-09-21T07:49:32Z</dc:date>
    </item>
  </channel>
</rss>

