Intel® oneAPI DL Framework Developer Toolkit
Get answers for developing new or customizing existing frameworks using common APIs.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
18 Discussions

How do I get the oneDNN C API to work on the GPU?

k_higashi
Beginner
1,141 Views

I want to implement training with oneDNN,
and use mallo/free instead of vector.

 

I used the sample code at the URL below. 
https://oneapi-src.github.io/oneDNN/cpu_cnn_training_f32_c.html

I changed the first code of simple_net().

from
CHECK(dnnl_engine_create(&engine, dnnl_cpu, 0)); // idx
to
CHECK(dnnl_engine_create(&engine, dnnl_gpu, 0)); // idx

When I build and run it, but I get an exception error.

What are you missing?
I want to know the correct way to implement oneDNN learning process in C API and run it on GPU.


<Information>
OS: Windows 10 Pro
Toolkit:
Intel oneAPI basetoolkit : 2021.2
CMake: 3.19.2
Ninja: 1.8.2

CPU: Intel Core i7-1165G7 2.80GHz
Accelerator:Intel Iris Xe Graphics
driver ver.: 27.20.100.9695(2021/04/29)

 

0 Kudos
1 Solution
JananiC_Intel
Moderator
1,127 Views

Hi,


Thanks for posting in Intel forums.


We are working on this. We will get back to you soon with updates.


Regards,

Janani Chandran


View solution in original post

5 Replies
JananiC_Intel
Moderator
1,128 Views

Hi,


Thanks for posting in Intel forums.


We are working on this. We will get back to you soon with updates.


Regards,

Janani Chandran


k_higashi
Beginner
1,109 Views

Thank you for your answer.

 

>We are working on this. We will get back to you soon with updates.

Is there something wrong with oneDNN library?
(Library bug.)

Is it just a sample code issue?
(For GPU, many changes to the sample code are required.)

 

Best Regard,

JananiC_Intel
Moderator
1,090 Views

Hi k_higashi,

 

For your information, we have set of samples that can work both on cpu and gpu but few samples are only cpu supported.Since your sample is cpu supported you are getting this error and not because of any bug.There are some oneDNN C APIs that support gpu.

You can refer this link (https://oneapi-src.github.io/oneDNN/dev_guide_examples.html) to know about the samples and its supported engine. Also you can follow oneDNN developer guide(https://oneapi-src.github.io/oneDNN/dev_guide_build.html) to build samples.

 

 

Regards,

Janani Chandran

 

JananiC_Intel
Moderator
1,079 Views

Hi,


Has the solution provided helped? Do you have any updates?


Regards,

Janani Chandran


JananiC_Intel
Moderator
1,049 Views

Hi,


Thanks for accepting the solution. If you need any additional information, please submit a new question as this thread will no longer be monitored.


Regards,

Janani Chandran



Reply