<?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 Re: Program runs fine on CPU but not on GPU (Inbuilt Intel GPU) in GPU Compute Software</title>
    <link>https://community.intel.com/t5/GPU-Compute-Software/Program-runs-fine-on-CPU-but-not-on-GPU-Inbuilt-Intel-GPU/m-p/1670730#M1755</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I think your program is not working on your integrated GPU because it is operating on memory allocated using "new":&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;double* transmitted_signal = new double[NUM_SAMPLES];&lt;/LI-CODE&gt;&lt;P&gt;This requires the "usm_system_allocations" device aspect, which many GPUs do not support.&lt;/P&gt;&lt;P&gt;For most GPUs, you want to allocate some other type of USM via SYCL instead, such as device USM, host USM, or shared USM.&amp;nbsp; See:&lt;/P&gt;&lt;P&gt;&lt;A href="https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_kinds_of_unified_shared_memory" target="_blank"&gt;https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_kinds_of_unified_shared_memory&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I also see that your drivers are fairly old.&amp;nbsp; I would strongly suggest updating your drivers to the latest version if at all possible.&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2025 15:26:28 GMT</pubDate>
    <dc:creator>Ben_A_Intel</dc:creator>
    <dc:date>2025-02-27T15:26:28Z</dc:date>
    <item>
      <title>Program runs fine on CPU but not on GPU (Inbuilt Intel GPU)</title>
      <link>https://community.intel.com/t5/GPU-Compute-Software/Program-runs-fine-on-CPU-but-not-on-GPU-Inbuilt-Intel-GPU/m-p/1669352#M1753</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hello Intel Community,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I am running a simple program(generation of chirp) on my system that works perfectly fine when executed on the CPU. However, when I try to run the same program utilizing the inbuilt Intel GPU, it encounters issues and doesn’t perform as expected.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;My system details are shown below:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[opencl:acc:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2024.17.3.0.08_160000]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[opencl:cpu:1] Intel(R) OpenCL, Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz OpenCL 3.0 (Build 0) [2024.17.3.0.08_160000]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[opencl:gpu:2] Intel(R) OpenCL HD Graphics, Intel(R) UHD Graphics OpenCL 2.1 NEO [27.20.100.8478]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The code is shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;iostream&amp;gt;   // C++ I/O
#include &amp;lt;cmath&amp;gt;      // Mathematical operations
#include &amp;lt;mkl.h&amp;gt;      // Intel MKL functions
#include &amp;lt;complex&amp;gt;    // C++ complex numbers
#include &amp;lt;CL/sycl.hpp&amp;gt;  // SYCL Header

// Constants
constexpr double SPEED_OF_SOUND = 1500.0;  
constexpr double SAMPLING_FREQUENCY = 1000000.0;  
constexpr double CENTER_FREQUENCY = 115000.0;  
constexpr double BANDWIDTH = 10000.0;  
constexpr double CHIRP_DURATION = 0.001;  
constexpr int NUM_SAMPLES = static_cast&amp;lt;int&amp;gt;(CHIRP_DURATION * SAMPLING_FREQUENCY);
constexpr double FSTART = (CENTER_FREQUENCY - (BANDWIDTH / 2));  

// Function to generate LFM chirp signal using SYCL
void generateChirp(double* signal, int num_samples, double fs, double fSTART, double bandwidth, double duration, sycl::queue&amp;amp; q) {
    double k = bandwidth / duration;  // Chirp rate (Hz/s)

    // SYCL parallel execution
    q.submit([&amp;amp;](sycl::handler&amp;amp; h) {
        h.parallel_for(sycl::range&amp;lt;1&amp;gt;(num_samples), [=](sycl::id&amp;lt;1&amp;gt; n) {
            double t = static_cast&amp;lt;double&amp;gt;(n) / fs;  // Time in seconds
            double phase = 2.0 *3.14* (fSTART * t + 0.5 * k * t * t);
            signal[n] = cos(phase);  // Generate chirp waveform
        });
    }).wait(); // Wait for GPU execution to complete
}

int main() {
    std::cout &amp;lt;&amp;lt; "C++ with SYCL Conversion Started..." &amp;lt;&amp;lt; std::endl;

    // Create a SYCL queue for GPU execution
    sycl::queue q{ sycl::gpu_selector() };

    // Allocate memory for signals
    double* transmitted_signal = new double[NUM_SAMPLES];
    double* received_signal = new double[NUM_SAMPLES];
    double* received_signal_noisy = new double[NUM_SAMPLES];

    // Generate Chirp Signal
    generateChirp(transmitted_signal, NUM_SAMPLES, SAMPLING_FREQUENCY, FSTART, BANDWIDTH, CHIRP_DURATION, q);

    std::cout &amp;lt;&amp;lt; "Chirp signal generated successfully!" &amp;lt;&amp;lt; std::endl;

    // Free allocated memory
    delete[] transmitted_signal;
    delete[] received_signal;
    delete[] received_signal_noisy;

    return 0;
}&lt;/LI-CODE&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>Mon, 24 Feb 2025 06:28:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/GPU-Compute-Software/Program-runs-fine-on-CPU-but-not-on-GPU-Inbuilt-Intel-GPU/m-p/1669352#M1753</guid>
      <dc:creator>Abhijit4</dc:creator>
      <dc:date>2025-02-24T06:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Program runs fine on CPU but not on GPU (Inbuilt Intel GPU)</title>
      <link>https://community.intel.com/t5/GPU-Compute-Software/Program-runs-fine-on-CPU-but-not-on-GPU-Inbuilt-Intel-GPU/m-p/1670730#M1755</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I think your program is not working on your integrated GPU because it is operating on memory allocated using "new":&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;double* transmitted_signal = new double[NUM_SAMPLES];&lt;/LI-CODE&gt;&lt;P&gt;This requires the "usm_system_allocations" device aspect, which many GPUs do not support.&lt;/P&gt;&lt;P&gt;For most GPUs, you want to allocate some other type of USM via SYCL instead, such as device USM, host USM, or shared USM.&amp;nbsp; See:&lt;/P&gt;&lt;P&gt;&lt;A href="https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_kinds_of_unified_shared_memory" target="_blank"&gt;https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_kinds_of_unified_shared_memory&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I also see that your drivers are fairly old.&amp;nbsp; I would strongly suggest updating your drivers to the latest version if at all possible.&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 15:26:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/GPU-Compute-Software/Program-runs-fine-on-CPU-but-not-on-GPU-Inbuilt-Intel-GPU/m-p/1670730#M1755</guid>
      <dc:creator>Ben_A_Intel</dc:creator>
      <dc:date>2025-02-27T15:26:28Z</dc:date>
    </item>
  </channel>
</rss>

