Skip to content

setting environment vars for oneapi makes gpu compute give incorrect output #691

Open
@Kuratius

Description

@Kuratius

I ran this example:

https://github.com/smistad/OpenCL-Getting-Started/

with environment variables set via

source /opt/intel/oneapi/setvars.sh
(this a script from the intel mkl , I ran this because I found a tutorial for testing opencl code that said it would help).

with the following modification: CL_DEVICE_TYPE_ALL in main.c changed to CL_DEVICE_TYPE_GPU

27 + 997 = 0
28 + 996 = 191839498
29 + 995 = 1703542117
30 + 994 = 1762132000
31 + 993 = 1818588270
32 + 992 = 1764635702
33 + 991 = 1845519459
34 + 990 = 26083801
35 + 989 = 0
36 + 988 = -1
37 + 987 = 2147483647

It seems that it always runs correctly for CL_DEVICE_TYPE_CPU , but it only runs correctly for CL_DEVICE_TYPE_GPU if these enviroment variables have not been set.

without the environment variables

clinfo -l
Platform #0: Intel(R) OpenCL Graphics
`-- Device #0: Intel(R) HD Graphics 520

and

27 + 997 = 1024
28 + 996 = 1024
29 + 995 = 1024
30 + 994 = 1024
31 + 993 = 1024
32 + 992 = 1024

with the environment variables:

clinfo -l
Platform #0: Intel(R) OpenCL
`-- Device #0: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Platform #1: Intel(R) OpenCL Graphics
`-- Device #0: Intel(R) HD Graphics 520 ```

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions