kernels.utility.cl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neureka Show documentation
Show all versions of neureka Show documentation
A platform independent tensor library written in Java.
//======================================================================================================================
void _cfg_of_cfg(__global int* cfg, int* new_cfg, int rank)
{
for(int i=0; i=rank*3 && i
{
int* idx = (cfg+rank*3);
int* idxMap = (cfg+rank*2);
if(Neureka.instance().settings().indexing().REVERSE_INDEX_TRANSLATION){
for(int ii=(rank)-1; ii>=0; ii--){
idx[ ii ] = (i/idxMap[ ii ]);//is derived from the shape of a tensor. Translates scalar indexAlias to dim-Index
i %= idxMap[ ii ];
}
} else {//---
for(int ii=0; ii
{
int* idxBase = (cfg+rank*5);
int* idxScale = (cfg+rank*4);
int* idx = (cfg+rank*3);
int* translation = (cfg+rank);
int i = 0;
for ( int ii = 0; ii < rank; ii++ ) {
i += (idx[ ii ]*idxScale[ ii ]+idxBase[ ii ]) * translation[ ii ];
}
return i;
}
//======================================================================================================================
© 2015 - 2025 Weber Informatics LLC | Privacy Policy