Part Number:TDA4VM
Hello!
When I use the mmalib library of ti processor sdk rtos-j721e evm, I find that MMALIB_ bufParams2D_ T's data_ Type uses MMALIB_ INT32,and use an integer array as input ,the program is OK。
But when I use a floating point array as input whether it is double or float,data_ Type used MMALIB_ FLOAT64 MMALIB_ FLOAT32, the code will be stuck. What should I do?
The result is:
[C7x_1 ] 5292.079344 s: 360
[C7x_1 ] 5292.079366 s: statusinit=10000
[C7x_1 ] 5292.079381 s: statusexec=0
There is a problem in MMALIB_ LINALG_ matrixMatrixMultiply_ ixX_ ixX_ oxX_ init_ checkParams(). Find the definition and find that when MMALIB_ STATUS=10000, which means Unsupported input data type, but I think since it exists, for example, MMALIB_ FLOAT64, there should be no problem in use.
Here is my code:
double matA[12]={1.1,2.2,3.6,4.7,5.2,6.6,7.7,8.2,9.9,10.2,11.1,12.2}; double matB[12]={1.1,2.2,3.6,4.7,5.2,6.6,7.7,8.2,9.9,10.2,11.1,12.2}; double matC[12]={1.1,2.2,3.6,4.7,5.2,6.6,7.7,8.2,9.9,10.2,11.1,12.2};const size_t rows = 4;const size_t cols= 3;MMALIB_bufParams2D_t aBuffer;aBuffer.data_type = MMALIB_FLOAT64;aBuffer.dim_x = cols;aBuffer.dim_y = rows;aBuffer.stride_y = aBuffer.dim_x * 8;MMALIB_bufParams2D_t bBuffer;bBuffer.data_type = MMALIB_FLOAT64;bBuffer.dim_x = 4;bBuffer.dim_y = 3;bBuffer.stride_y = bBuffer.dim_x * 8;MMALIB_bufParams2D_t resultBuffer;resultBuffer.data_type = MMALIB_FLOAT64;resultBuffer.dim_x = 4;resultBuffer.dim_y = 4;resultBuffer.stride_y =resultBuffer.dim_x * 8;MMALIB_STATUS statusinit = MMALIB_SUCCESS;MMALIB_STATUS statusexec = MMALIB_SUCCESS;MMALIB_LINALG_matrixMatrixMultiply_ixX_ixX_oxX_InitArgs initArgs;initArgs.funcStyle = MMALIB_FUNCTION_OPTIMIZED;initArgs.shift = 0;int32_t handleSize = MMALIB_LINALG_matrixMatrixMultiply_ixX_ixX_oxX_getHandleSize(&initArgs);MMALIB_kernelHandle kernelHandle = malloc(handleSize);std::cout <<handleSize<< std::endl;statusinit =MMALIB_LINALG_matrixMatrixMultiply_ixX_ixX_oxX_init_checkParams(kernelHandle,&aBuffer,&bBuffer,&resultBuffer,&initArgs);std::cout <<"statusinit"<<std::to_string(statusinit)<<std::endl;if(statusinit == MMALIB_SUCCESS){statusinit = MMALIB_LINALG_matrixMatrixMultiply_ixX_ixX_oxX_init(kernelHandle,&aBuffer,&bBuffer,&resultBuffer,&initArgs);}statusexec = MMALIB_LINALG_matrixMatrixMultiply_ixX_ixX_oxX_exec_checkParams(kernelHandle,&matA[0],&matB[0],&matC[0]);std::cout<<"statusexec"<<std::to_string(statusexec)<<std::endl;if(statusexec == MMALIB_SUCCESS){statusexec = MMALIB_LINALG_matrixMatrixMultiply_ixX_ixX_oxX_exec(kernelHandle,&matA[0],&matB[0],&matC[0]);}size_t size = 12;for (size_t i = 0; i <size ; ++i){std::cout <<" "<<matC[i];}free(kernelHandle);
Shine:
我把您的问题转到英文e2e论坛了,请关注下面帖子的回复。https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1136591/tda4vm-issue-for-data_-type-mmalib_float64