Returns the first element of the array.
More...
| template<typename T > |
| T | scalar () const |
| | Returns host-side scalar of first component of data. More...
|
| |
Returns the first element of the array.
Gets the first element of the array and transefer it to the host.
Returns host-side scalar of first component of data.
No need to call unlock() afterward.
float f[] = {1,2,3,4};
float scalar = a.scalar<
float>();
printf("%f\n",scalar);