You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ctype dict is generally useful and could be added to bh.user_kernel.
Contents of lookup-cpu.c:
#include<stdint.h>#include<stdio.h>#include<complex.h>typedef %(ctype)sscalar_t;
/* A: Am x Ai x An -> Am x Ii x An */voidindex_axis(scalar_t*O,
scalar_t*A, uint64_tAm, uint64_tAi, uint64_tAn,
int64_t*Index, uint64_tIi)
{
#pragma omp parallel for collapse(3)
for(uint64_ti=0;i<Am;i++)
for(uint64_tj=0;j<Ii;j++)
for(uint64_tk=0;k<An;k++){
uint64_tI_j=Index[j]>=0? Index[j] : Ai+Index[j];
O[k+j*An+i*Ii*An] =A[k+I_j*An+i*Ai*An];
}
}
voidexecute(scalar_t*O, scalar_t*A, int64_t*Index)
{
uint64_tAm= %(Am)d, Ai= %(Ai)d, Ii= %(Ii)d, An=%(An)d;
returnindex_axis(O, A,Am,Ai,An, Index,Ii);
}
Example:
Numpy result:
Bohrium result:
The text was updated successfully, but these errors were encountered: