cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ryta1203
Journeyman III

CAL resource allocation

Is it possible to somehow use arrays for mapping resources on the CAL side, such as:

 

 

 

 

 

 

 

 

 

CALresource inLocal[8], outLocal;

 

 

for

(i=0;i<num_inputs;i++)

{

inLocal = 0;

 



 

if

(calResAllocLocal2D(&inLocal, device, cal_size, cal_size, CAL_FORMAT_FLOAT_1, 0) != CAL_RESULT_OK)

fprintf(stderr,



 

"error occured allocating resource inLocal %d"

, i);

}

 



 

//if(calResAllocLocal2D(&inLocal, device, cal_size, cal_size, CAL_FORMAT_FLOAT_1, 0) != CAL_RESULT_OK)

 

 

// fprintf(stderr, "error occured allocating resource inLocal");

 

 

//if(calResAllocLocal2D(&in2Local, device, cal_size, cal_size, CAL_FORMAT_FLOAT_1, 0) != CAL_RESULT_OK)

 

 

// fprintf(stderr, "error occured allocating resource in2Local");

 

 

if

(calResAllocLocal2D(&outLocal, device, cal_size, cal_size, CAL_FORMAT_FLOAT_1, 0) != CAL_RESULT_OK)

fprintf(stderr,



 

"error occured allocating resource outLocal"

);





0 Likes
2 Replies
the729
Journeyman III

Hi, the samples shipped with CAL are doing it.

See CALROOT/samples/common/Samples.cpp

0 Likes

Thanks, I posted too soon. I noticed this right after I found my error, sorry. Now if only I could get answers to the important questions!

0 Likes