Part Number:TDA4VM
你好
当我使用ti processor sdk rtos-j721e evm的mmalib库时,我发现mmalib_bufParams2D_T的data_Type使用mmalib_INT32,并使用整数数组作为输入,程序正常。
但当我使用浮点数组作为输入时,无论data_Type是 MMALIB_FLOAT64 还是MMALIB_FLOAT32,代码都会被卡住。我该怎么办?
结果是:
[C7x_1]5292.079344秒:360
[C7x_1]5292.079366秒:statusinit=10000
[C7x_1]5292.079381秒:statusexec = 0
MMALIB_LINALG_MatrixMultiply_ixX_ ixX_oxX_ init_ checkParams()中存在问题。查找定义并发现当MMALIB_STATUS=10000时,意味着不支持的输入数据类型,但我认为因为它存在,例如MMALIB_FLOAT64,所以使用时应该没有问题。
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:
请参考您的另外一个帖子。https://e2echina.ti.com/support/processors/f/processors-forum/288624/tda4vm-data_-type-mmalib_float64-something-went-wrong