All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kernels.utility.cl Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version

//======================================================================================================================

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