Intel® oneAPI DL Framework Developer Toolkit
Gain insights from peers and Intel experts to develop new deep learning frameworks or to customize an framework utilizing common APIs.
25 Discussions

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

k_higashi
Beginner
2,968 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
2,954 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

0 Kudos
5 Replies
JananiC_Intel
Moderator
2,955 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


0 Kudos
k_higashi
Beginner
2,936 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,

0 Kudos
JananiC_Intel
Moderator
2,917 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

 

0 Kudos
JananiC_Intel
Moderator
2,906 Views

Hi,


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


Regards,

Janani Chandran


0 Kudos
JananiC_Intel
Moderator
2,876 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



0 Kudos
Reply