oneDNN icon indicating copy to clipboard operation
oneDNN copied to clipboard

Memory type conversion to c++ array

Open RadjaHachilif opened this issue 8 years ago • 2 comments

Hello people, The function eltwise_forward takes memory type as a destination for operations. How could i convert that result ( destination content ) to a C++ array ?

RadjaHachilif avatar Oct 06 '18 18:10 RadjaHachilif

You can use get_data_handle() to get the pointer to the allocated destination memory, and get the data from the memory in specific data type. For example, you can access the ith floating data in destination memory (dst) using (float *)dst.get_data_handle())[i].

qyi1 avatar Oct 08 '18 17:10 qyi1

Feel free to reopen this issue or submit a new one if you have any other questions.

vpirogov avatar Oct 09 '18 23:10 vpirogov