Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings in serial/CUDA kernels. #333

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 32 additions & 36 deletions examples/ethier/ethier.oudf
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,29 @@ void exact(dfloat *u, dfloat *v, dfloat *w, dfloat *p,
const dfloat x, const dfloat y, const dfloat z,
const dfloat t, const dfloat visc)
{
dfloat a = p_A;
dfloat d = p_D;
dfloat ex,ey,ez;
dfloat exy,eyz,ezx,sxy,syz,szx,cxy,cyz,czx,e2t;
const dfloat a = p_A;
const dfloat d = p_D;

const dfloat xx = x - p_U0*t;
const dfloat yy = y - p_V0*t;
const dfloat zz = z - p_W0*t;

ex = exp(a*xx);
ey = exp(a*yy);
ez = exp(a*zz);
e2t = exp(-visc*d*d*t);
const dfloat ex = exp(a*xx);
const dfloat ey = exp(a*yy);
const dfloat ez = exp(a*zz);
const dfloat e2t = exp(-visc*d*d*t);

exy = exp(a*(xx + yy));
eyz = exp(a*(yy + zz));
ezx = exp(a*(zz + xx));
const dfloat exy = exp(a*(xx + yy));
const dfloat eyz = exp(a*(yy + zz));
const dfloat ezx = exp(a*(zz + xx));

sxy = sin(a*xx + d*yy);
syz = sin(a*yy + d*zz);
szx = sin(a*zz + d*xx);
cxy = cos(a*xx + d*yy);
cyz = cos(a*yy + d*zz);
czx = cos(a*zz + d*xx);
const dfloat sxy = sin(a*xx + d*yy);
const dfloat syz = sin(a*yy + d*zz);
const dfloat szx = sin(a*zz + d*xx);

const dfloat cxy = cos(a*xx + d*yy);
const dfloat cyz = cos(a*yy + d*zz);
const dfloat czx = cos(a*zz + d*xx);

*(u)= -a*(ex*syz + ez*cxy)*e2t + p_U0;
*(v)= -a*(ey*szx + ex*cyz)*e2t + p_V0;
Expand All @@ -84,31 +82,29 @@ void grad_u(dfloat *grad_u_x, dfloat *grad_u_y, dfloat *grad_u_z,
const dfloat x, const dfloat y, const dfloat z,
const dfloat t, const dfloat visc)
{
dfloat a = p_A;
dfloat d = p_D;
dfloat ex,ey,ez;
dfloat exy,eyz,ezx,sxy,syz,szx,cxy,cyz,czx,e2t;
const dfloat a = p_A;
const dfloat d = p_D;

const dfloat xx = x - p_U0*t;
const dfloat yy = y - p_V0*t;
const dfloat zz = z - p_W0*t;

ex = exp(a*xx);
ey = exp(a*yy);
ez = exp(a*zz);
e2t = exp(-visc*d*d*t);
const dfloat ex = exp(a*xx);
const dfloat ey = exp(a*yy);
const dfloat ez = exp(a*zz);
const dfloat e2t = exp(-visc*d*d*t);

exy = exp(a*(xx + yy));
eyz = exp(a*(yy + zz));
ezx = exp(a*(zz + xx));
const dfloat exy = exp(a*(xx + yy));
const dfloat eyz = exp(a*(yy + zz));
const dfloat ezx = exp(a*(zz + xx));

sxy = sin(a*xx + d*yy);
syz = sin(a*yy + d*zz);
szx = sin(a*zz + d*xx);
const dfloat sxy = sin(a*xx + d*yy);
const dfloat syz = sin(a*yy + d*zz);
const dfloat szx = sin(a*zz + d*xx);

cxy = cos(a*xx + d*yy);
cyz = cos(a*yy + d*zz);
czx = cos(a*zz + d*xx);
const dfloat cxy = cos(a*xx + d*yy);
const dfloat cyz = cos(a*yy + d*zz);
const dfloat czx = cos(a*zz + d*xx);

//*(u)= -a*(ex*syz + ez*cxy)*e2t;
*(grad_u_x)= -a*((a*ex)*syz -a*ez*sxy)*e2t;
Expand Down Expand Up @@ -173,7 +169,7 @@ void scalarNeumannConditions(bcData *bc)
@restrict const dfloat * z,
@restrict dfloat * W)
{
for(dlong n=0;n<Ntotal;++n;@tile(256,@outer,@inner)){
for(dlong n=0;n<Ntotal;++n;@tile(p_blockSize,@outer,@inner)){
const dfloat ampx = p_amp*cos(p_omega*time);
const dfloat ampy = p_amp*cos(0.5*p_omega*time);
const dfloat ampz = p_amp*cos(0.5*0.5*p_omega*time);
Expand Down
13 changes: 5 additions & 8 deletions okl/cds/advectionHex3D.okl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
for(int i = 0; i < p_Nq; ++i; @inner(0)) {
dlong id = i + j * p_Nq;
if(k == 0)
s_D[0][id] = D[id];
s_D[j][i] = D[id];

id = e * p_Np + k * p_Nq * p_Nq + j * p_Nq + i;

Expand All @@ -64,7 +64,6 @@

for(int j = 0; j < p_Nq; ++j; @inner(1)) {
for(int i = 0; i < p_Nq; ++i; @inner(0)) {
const dlong gid = e * p_Np * p_Nvgeo + k * p_Nq * p_Nq + j * p_Nq + i;
const dlong id = e * p_Np + k * p_Nq * p_Nq + j * p_Nq + i;
dfloat dSdr = 0, dSds = 0, dSdt = 0;

Expand Down Expand Up @@ -108,7 +107,6 @@
for(dlong e = 0; e < Nelements; ++e; @outer(0)) {
@shared dfloat s_cubD[p_cubNq][p_cubNq];
@shared dfloat s_cubInterpT[p_Nq][p_cubNq];
@shared dfloat s_cubProjectT[p_cubNq][p_Nq];

@shared dfloat s_S[p_cubNq][p_cubNq];

Expand All @@ -120,11 +118,10 @@
for(int i = 0; i < p_cubNq; ++i; @inner(0)) {
const int id = i + j * p_cubNq;
if (id < p_Nq * p_cubNq) {
s_cubInterpT[0][id] = cubInterpT[id];
s_cubProjectT[0][id] = cubProjectT[id];
s_cubInterpT[j][i] = cubInterpT[id];
}

s_cubD[0][id] = cubD[id];
s_cubD[j][i] = cubD[id];

#pragma unroll p_cubNq
for(int k = 0; k < p_cubNq; ++k) {
Expand Down Expand Up @@ -152,7 +149,7 @@
for(int b = 0; b < p_cubNq; ++b; @inner(1))
for(int i = 0; i < p_cubNq; ++i; @inner(0))
if(b < p_Nq) {
dfloat U1 = 0, V1 = 0, W1 = 0, S1 = 0;
dfloat S1 = 0;
for(int a = 0; a < p_Nq; ++a) {
dfloat Iia = s_cubInterpT[a][i];
S1 += Iia * s_S[b][a];
Expand All @@ -166,7 +163,7 @@
// interpolate in 's'
for(int j = 0; j < p_cubNq; ++j; @inner(1)) {
for(int i = 0; i < p_cubNq; ++i; @inner(0)) {
dfloat U2 = 0, V2 = 0, W2 = 0, S2 = 0;
dfloat S2 = 0;
// interpolate in b
for(int b = 0; b < p_Nq; ++b) {
dfloat Ijb = s_cubInterpT[b][j];
Expand Down
3 changes: 0 additions & 3 deletions okl/cds/helmholtzBCHex3D.okl
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@
for(dlong e = 0; e < Nelements; ++e; @outer(0)) {
@shared dfloat s_ndU[p_Nq][p_Nq];

#define s_Gur s_ndU

@exclusive dfloat r_ut, r_Gut, r_Auk;
@exclusive dfloat r_rhsU[p_Nq]; // array for results Au(i,j,0:N)

// for all face nodes of all elements
Expand Down
2 changes: 1 addition & 1 deletion okl/cds/regularization/filterRTHex3D.okl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
for(int j = 0; j < p_Nq; ++j; @inner(1)) {
for(int i = 0; i < p_Nq; ++i; @inner(0)) {
const int id = i + j * p_Nq;
s_FT[0][id] = fMT[id + is * p_Nq * p_Nq];
s_FT[j][i] = fMT[id + is * p_Nq * p_Nq];

#pragma unroll p_Nq
for(int k = 0; k < p_Nq; ++k)
Expand Down
Loading