I want to use mkl to implement simple 3D convolution, for example, my input data size is 10*450*2456, I use a 5*5*5 convolution kernel, the output data size should be 6*446*2452, I use these parameters, refer to the official sample code, but it does't works. I have been using the vsldConvExecX command, it return an uncertain integer, I think the official example code and documentation for how to set the step and code instructions are very vague, hope to add some content to explain more clearly, thank you! By the way, I would appreciate it, if I can get the code for my calculation example.
I finally finally found my error, which came from my carelessness:
status = vsldConvExecX(&my_task, m_filter, NULL, m_output, NULL);
This sentence does not need to take the address"&", but I wrote it and did not report errors, so it has been ignored by me.
One thing to note, this is required for functions that create tasks:
int status = vsldConvNewTaskX(&my_task, VSL_CONV_MODE_AUTO, 3, inputDims, filterDims, outputDims, m_input, NULL);
I also learned from the official samples that if there is no special stride and padding required, NULL can be used directly
Now my script is running well, thank you for being so patient to help me solve my problem, wish you happy every day!!!⊂◉‿◉つ
链接已复制
Sorry it took so long to get back to you;<(。_。)>
My problem has not been solved, it was my fault to set it to be solved; I just tried cudnn to solve my problem, it worked well (but my 8G GPU memory is running out), so I still want to use the CPU to calculate convolution( just like the MATLAB). I took a moment to rewrite the code with it below, thanks very much for answering my question and pointing out my errors.
I didn't use cmake to build my project, I just created a new empty project in visual studio, my include file was correct, and I used Intel Libraries for OneAPI in VS for mkl configuration.As shown in Figure 1 below. When I run my script, the error code looks like Figure 2, and I can't find the cause of the error in the error code's documentation.
Surprisingly, I updated it using the APP: "Intel oneAPI base Toolkit" ,and didn't need to worry about uninstalling older version.
ɷ◡ɷ
yep,I have completed your previous suggestion, but my problem now is that when I execute vsldConvExecX, It will report an error of crossing the boundary. Is my stride wrong?
My code is as follows:
I read the references to Convolution and Correlation Data Allocation carefully:https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2024-1/convolution-and-correlation-data-allocation.html#GUID-EC3E2E6B-4989-4AF1-A3A8-7BAE7C945E05 ,and I modified my stride to:
const MKL_INT xstride[3]{ inputDims[1]* inputDims[2],inputDims[2],1};
const MKL_INT ystride[3]{ filterDims[1] * filterDims[2],filterDims[2],1 };
const MKL_INT zstride[3]{ outputDims[1] * outputDims[2],outputDims[2],1 };
but it doesn't help, the error is the same as the previous one.
I finally finally found my error, which came from my carelessness:
status = vsldConvExecX(&my_task, m_filter, NULL, m_output, NULL);
This sentence does not need to take the address"&", but I wrote it and did not report errors, so it has been ignored by me.
One thing to note, this is required for functions that create tasks:
int status = vsldConvNewTaskX(&my_task, VSL_CONV_MODE_AUTO, 3, inputDims, filterDims, outputDims, m_input, NULL);
I also learned from the official samples that if there is no special stride and padding required, NULL can be used directly
Now my script is running well, thank you for being so patient to help me solve my problem, wish you happy every day!!!⊂◉‿◉つ