add endian option in cl tensor functions

This commit is contained in:
2024-02-02 23:13:22 +01:00
parent 70b1177e5f
commit 7dd749f85e
5 changed files with 127 additions and 6 deletions
+29
View File
@@ -25,6 +25,35 @@ __kernel void prodTensori2dLin_TYPE_DOUBLE(long unsigned int M1rank, __global co
}
__kernel void prodTensor2dLinNotEndian_TYPE_FLOAT(long unsigned int M0rank, __global const float *M0x , __global const float *M1x, __global float *Mx ){
//Get the index of the current element to be processed
size_t i = get_group_id(0)*get_local_size(0) + get_local_id(0);
size_t j = get_group_id(1)*get_local_size(1) + get_local_id(1);
//size_t i = get_global_id(0);
//size_t j = get_global_id(1);
size_t k = i + M0rank * j;
Mx[k] = M0x[i] * M1x[j];
}
__kernel void prodTensori2dLinNotEndian_TYPE_DOUBLE(long unsigned int M0rank, __global const double *M0x , __global const double *M1x, __global double *Mx ){
//Get the index of the current element to be processed
size_t i = get_group_id(0)*get_local_size(0) + get_local_id(0);
size_t j = get_group_id(1)*get_local_size(1) + get_local_id(1);
//size_t i = get_global_id(0);
//size_t j = get_global_id(1);
size_t k = i + M0rank * j;
Mx[k] = M0x[i] * M1x[j];
}