cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

thesquiff
Journeyman III

CAL types

When should I be using CALint? The examples and documentation seem a bit inconsistent, sometimes using CALint and sometimes using int. What is the difference?

 

Also does CAL have vector types, like the float4 available in Brook+?

 

Thanks

Tags (2)
0 Likes
3 Replies
rick_weber
Adept II

CAL types

CALint is typedefed to int. In general, whenever using the CAL API, I would use CALint, so that if its type changes for some reason in the future, your code won't break.

Edit: Yes, it has vector types. When you allocate the resource, you tell it what type of resource it is (i.e. CAL_FORMAT_FLOAT_4 is the same as float4). CAL doesn't have float3s but you can emulate these using float4s.

0 Likes
thesquiff
Journeyman III

CAL types

Thanks for that, although I was hoping there'd be something like CALint2? Not that I *need* it, I'm converting some CUDA code and thought it would be a useful thing to have.

0 Likes
rick_weber
Adept II

CAL types

Cal does support int2. See page 3-11 in the Stream Computing User Guide.

0 Likes