From 999de820a81a555991670880ef526dc4ad19b809 Mon Sep 17 00:00:00 2001 From: sflorescu <43118429+sflorescu@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:23:26 +0100 Subject: [PATCH] Added check if prepare runs --- matlab/prepare_a_matrix_mex.cu | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/matlab/prepare_a_matrix_mex.cu b/matlab/prepare_a_matrix_mex.cu index adee42c..5d8c658 100644 --- a/matlab/prepare_a_matrix_mex.cu +++ b/matlab/prepare_a_matrix_mex.cu @@ -3,11 +3,10 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { if (nrhs != 5) { - mexErrMsgIdAndTxt("beamformer_mex:InvalidInput", + mexErrMsgIdAndTxt("prepare_a_matrix_mex:InvalidInput", "Five inputs required: a_matrix_in, a_matrix_out, pixels, samples, device_id"); } - // Extract arguments from MATLAB inputs char *a_matrix_in_c = mxArrayToString(prhs[0]); char *a_matrix_out_c = mxArrayToString(prhs[1]); double pixels_d = mxGetScalar(prhs[2]); @@ -25,7 +24,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int status = prepareAMatrix(a_matrix_in, a_matrix_out, pixels, samples, device_id); + if (status == 0) { + mexPrintf("prepareAMatrix completed successfully.\n"); + } else { + mexPrintf("prepareAMatrix failed with status code: %d\n", status); + } + if (nlhs > 0) { - plhs[0] = mxCreateDoubleScalar(static_cast(status)); + plhs[0] = mxCreateDoubleScalar((double)status); } }