OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

Crash 32 bit application with Intel CPU Runtime for OpenCL 22

FabianoR
Beginner
1,230 Views

Hi,

I observed a problem with your new OpenCL runtime ver. 22.

I have an old 32bit application for windows that allows me to detect the OpenCL platforms present in the system and with your new runtime the application throw an exception when the program exits.

 

I tried to do a very simple test like this:

 

#include <iostream>
#include "CL/opencl.h"
#include <Windows.h>

int main()
{
    cl_uint platformIdCount = 0;
    clGetPlatformIDs(0, NULL, &platformIdCount);

    std::cout << "Hello World!\n";

    return (int)platformIdCount;
}

 

and I have this exception at the end

FabianoR_0-1647532522357.png

 

This problem is not present with OpenCL runtime ver 21.

Did I do something wrong? Is it a known bug?

I have not found anything about it.

 

Thanks

Fabiano

 

Labels (1)
0 Kudos
5 Replies
cw_intel
Moderator
1,098 Views

Hi,

Could you provide the command you used?

I can build from my end,

// main.cpp

#include <iostream>

#include "CL/cl.h"

#include <Windows.h>

int main()

{

  cl_uint platformIdCount = 0;

  clGetPlatformIDs(0, NULL, &platformIdCount);

  std::cout << "Hello World!\n";

  std::cout << (int)platformIdCount << std::endl;

  return (int)platformIdCount;

}

I used the below command to build the code and it could work successfully.​

> icx main.cpp /I"C:\Program Files (x86)\Intel\oneAPI\compiler\2022.0.3\windows\include\sycl" /link "C:\Program Files (x86)\Intel\oneAPI\compiler\2022.0.3\windows\lib\x86\intelocl32.lib"


Thanks


0 Kudos
FabianoR
Beginner
1,091 Views

Hi

I compile the test from VisualStudio and I don't link directly the intel lib intelocl32.lib, but the opencl.lib from nvidia SDK

In the list of the dependent modules there are 2 intel dlls loaded: intelocl32.dll and intelocl32_emu.dll

 

I saw that the problem is present also if I use LoadLibrary

 

int main()
{
    HMODULE hm = LoadLibraryA("OpenCL.dll");

    typedef cl_int(CL_API_CALL* PFN_OPENCL_GET_PLATFORM_IDS) (cl_uint, cl_platform_id*, cl_uint*);

    PFN_OPENCL_GET_PLATFORM_IDS pfnOpenCLGetPlatformIDs = NULL;
    pfnOpenCLGetPlatformIDs = (PFN_OPENCL_GET_PLATFORM_IDS)::GetProcAddress(hm, "clGetPlatformIDs");
    if (pfnOpenCLGetPlatformIDs == NULL)
        return -1;

    // Estraggo le platform disponibili
    cl_uint platformIdCount = 0;
    pfnOpenCLGetPlatformIDs(0, NULL, &platformIdCount);

    FreeLibrary(hm);

    std::cout << "Hello World!\n";

    return (int)platformIdCount;
}

 

Thanks

 

Fabiano

0 Kudos
cw_intel
Moderator
1,052 Views

Hi,


With your loadlibrary code, I still can't reproduce your issue. Could you provide your visual studio output log?


Thanks


0 Kudos
cw_intel
Moderator
1,021 Views

Hi,


We haven't heard back from you for a long time so we are assuming that you have found a solution on your own. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Thanks.



0 Kudos
FabianoR
Beginner
1,016 Views

Hi,

I'm sorry, but I also opened a ticket and they recommended me a workaround for the problem.

So 

 

Fabiano

0 Kudos
Reply