Skip to content

Commit 5ee9aa7

Browse files
committed
create_image_ID retuns errno_t
1 parent bfd9d87 commit 5ee9aa7

8 files changed

+203
-144
lines changed

GPU_SVD_computeControlMatrix.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ errno_t GPU_SVD_computeControlMatrix(
387387
save_fits(ID_VTmatrix_name, "!matVT.fits");
388388

389389
cublasStatus_t cublasStat = cublasSgemm(cublasH, CUBLAS_OP_T, CUBLAS_OP_T, n, m, n, &alpha, d_VT,
390-
n, d_U, m, &beta, d_M, n);
390+
n, d_U, m, &beta, d_M, n);
391391
if(cublasStat != CUBLAS_STATUS_SUCCESS)
392392
{
393393
printf("cublasSgemm returned error code %d, line(%d)\n", cudaStat, __LINE__);
@@ -411,13 +411,14 @@ errno_t GPU_SVD_computeControlMatrix(
411411
}
412412

413413

414-
ID_Cmatrix = create_image_ID(
415-
ID_Cmatrix_name,
416-
data.image[ID_Rmatrix].md[0].naxis,
417-
arraysizetmp,
418-
_DATATYPE_FLOAT,
419-
0,
420-
0, 0);
414+
create_image_ID(
415+
ID_Cmatrix_name,
416+
data.image[ID_Rmatrix].md[0].naxis,
417+
arraysizetmp,
418+
_DATATYPE_FLOAT,
419+
0,
420+
0, 0,
421+
&ID_Cmatrix);
421422

422423

423424
// cudaStat = cudaMemcpy(data.image[ID_Cmatrix].array.F, d_M, sizeof(float)*m*n, cudaMemcpyDeviceToHost);

GPU_loop_MultMat_setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ errno_t GPU_loop_MultMat_setup(
235235
sizearraytmp = (uint32_t *) malloc(sizeof(uint32_t) * 2);
236236
sizearraytmp[0] = gpumatmultconf[index].M;
237237
sizearraytmp[1] = 1;
238-
gpumatmultconf[index].IDout = create_image_ID(IDoutdmmodes_name, 2,
239-
sizearraytmp, _DATATYPE_FLOAT, 1, 10, 0);
238+
create_image_ID(IDoutdmmodes_name, 2,
239+
sizearraytmp, _DATATYPE_FLOAT, 1, 10, 0,
240+
&(gpumatmultconf[index].IDout));
240241
free(sizearraytmp);
241242
}
242243
else

MatMatMult_testPseudoInverse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ long CUDACOMP_MatMatMult_testPseudoInverse(
208208

209209
arraysizetmp[0] = N;
210210
arraysizetmp[1] = N;
211-
IDmatOut = create_image_ID(IDmatOut_name, 2, arraysizetmp, _DATATYPE_FLOAT, 0,
212-
0, 0);
211+
create_image_ID(IDmatOut_name, 2, arraysizetmp, _DATATYPE_FLOAT, 0,
212+
0, 0, &IDmatOut);
213213

214214

215215
for(ii = 0; ii < N * N; ii++)

cudacomp_MVMextractModesLoop.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ errno_t __attribute__((hot)) CUDACOMP_MVMextractModesLoop_RUN()
751751

752752
ID_modeval = image_ID(IDmodes_val_name);
753753
if(ID_modeval == -1) { // CREATE IT
754-
ID_modeval = create_image_ID(IDmodes_val_name, 2, arraytmp, _DATATYPE_FLOAT, 1, 0, 0);
754+
create_image_ID(IDmodes_val_name, 2, arraytmp, _DATATYPE_FLOAT, 1, 0, 0, &ID_modeval);
755755
COREMOD_MEMORY_image_set_createsem(IDmodes_val_name, 10);
756756
MODEVALCOMPUTE = 1;
757757
} else { // USE STREAM, DO NOT COMPUTE IT
@@ -885,7 +885,7 @@ errno_t __attribute__((hot)) CUDACOMP_MVMextractModesLoop_RUN()
885885
}
886886
}
887887
if(imOK == 0) {
888-
IDtrace = create_image_ID(traceim_name, 2, sizearraytmp, _DATATYPE_FLOAT, 1, 0, 0);
888+
create_image_ID(traceim_name, 2, sizearraytmp, _DATATYPE_FLOAT, 1, 0, 0, &IDtrace);
889889
}
890890
COREMOD_MEMORY_image_set_createsem(traceim_name, 10);
891891
free(sizearraytmp);
@@ -923,7 +923,7 @@ errno_t __attribute__((hot)) CUDACOMP_MVMextractModesLoop_RUN()
923923
}
924924
}
925925
if(imOK == 0) {
926-
IDprocave = create_image_ID(process_ave_name, 2, sizearraytmp, _DATATYPE_FLOAT, 1, 0, 0);
926+
create_image_ID(process_ave_name, 2, sizearraytmp, _DATATYPE_FLOAT, 1, 0, 0, &IDprocave);
927927
}
928928
COREMOD_MEMORY_image_set_createsem(process_ave_name, 10);
929929
free(sizearraytmp);
@@ -955,7 +955,7 @@ errno_t __attribute__((hot)) CUDACOMP_MVMextractModesLoop_RUN()
955955
}
956956
}
957957
if(imOK == 0) {
958-
IDprocrms = create_image_ID(process_rms_name, 2, sizearraytmp, _DATATYPE_FLOAT, 1, 0, 0);
958+
create_image_ID(process_rms_name, 2, sizearraytmp, _DATATYPE_FLOAT, 1, 0, 0, &IDprocrms);
959959
}
960960
COREMOD_MEMORY_image_set_createsem(process_rms_name, 10);
961961
free(sizearraytmp);

cudacomptest.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ errno_t cudacomptest_addCLIcmd()
6666
"<NB actuators [long]> <NB modes [long]> <NB pixels [long]> <NB GPU [long]>",
6767
"cudacomptest 1000 20 1000 1",
6868
"int GPUcomp_test(long NBact, long NBmodes, long WFSsize, long GPUcnt)"
69-
);
69+
);
7070

7171

7272
return RETURN_SUCCESS;
@@ -172,18 +172,18 @@ errno_t GPUcomp_test(
172172
cmsize[0] = WFSsize;
173173
cmsize[1] = WFSsize;
174174
cmsize[2] = NBmodes;
175-
ID_contrM = create_image_ID("cudatestcm", 3, cmsize, _DATATYPE_FLOAT, 1, 0, 0);
175+
create_image_ID("cudatestcm", 3, cmsize, _DATATYPE_FLOAT, 1, 0, 0, &ID_contrM);
176176

177177
wfssize = (uint32_t *) malloc(sizeof(uint32_t) * 2);
178178
wfssize[0] = WFSsize;
179179
wfssize[1] = WFSsize;
180-
ID_WFS = create_image_ID("cudatestwfs", 2, wfssize, _DATATYPE_FLOAT, 1, 0, 0);
180+
create_image_ID("cudatestwfs", 2, wfssize, _DATATYPE_FLOAT, 1, 0, 0, &ID_WFS);
181181

182182
cmdmodessize = (uint32_t *) malloc(sizeof(uint32_t) * 2);
183183
cmdmodessize[0] = NBmodes;
184184
cmdmodessize[1] = 1;
185-
ID_cmd_modes = create_image_ID("cudatestcmd", 2, cmdmodessize, _DATATYPE_FLOAT,
186-
1, 0, 0);
185+
create_image_ID("cudatestcmd", 2, cmdmodessize, _DATATYPE_FLOAT,
186+
1, 0, 0, &ID_cmd_modes);
187187

188188
GPU_loop_MultMat_setup(0, data.image[ID_contrM].name, data.image[ID_WFS].name,
189189
data.image[ID_cmd_modes].name, GPUcnt, GPUdevices, 0, 1, 1, 0);

0 commit comments

Comments
 (0)