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

WIP: Change 3D thread blocking pattern to 2D thread blocking pattern #114

Closed
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
36 changes: 18 additions & 18 deletions src/libP/solvers/elliptic/okl/ellipticBuildDiagonalHex3D.okl
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ SOFTWARE.


// prefetch lamda 0
for(int k=0;k<p_Nq;++k;@inner(2)){
for(int j=0;j<p_Nq;++j;@inner(1)){
for(int i=0;i<p_Nq;++i;@inner(0)){
for(int k=0;k<p_Nq;++k;@inner(1)){
for(int j=0;j<p_Nq;++j;@inner(0)){
for(int i=0;i<p_Nq;++i){
const dlong id = e*p_Np+k*p_Nq*p_Nq+j*p_Nq+i;
const dlong base = e*p_Nggeo*p_Np + k*p_Nq*p_Nq + j*p_Nq + i;

Expand All @@ -78,9 +78,9 @@ SOFTWARE.
@barrier("local");

// loop over slabs
for(int k=0;k<p_Nq;++k;@inner(2)){
for(int j=0;j<p_Nq;++j;@inner(1)){
for(int i=0;i<p_Nq;++i;@inner(0)){
for(int k=0;k<p_Nq;++k;@inner(1)){
for(int j=0;j<p_Nq;++j;@inner(0)){
for(int i=0;i<p_Nq;++i){
const dlong id = e*p_Np+k*p_Nq*p_Nq+j*p_Nq+i;
dfloat r_q = 1.0f;
const int if_not_masked = (mapB[id] !=1 ) ? 1:0;
Expand Down Expand Up @@ -149,9 +149,9 @@ SOFTWARE.
@exclusive int r_masked;

// prefetch lamda 0
for(int k=0;k<p_Nq;++k;@inner(2)){
for(int j=0;j<p_Nq;++j;@inner(1)){
for(int i=0;i<p_Nq;++i;@inner(0)){
for(int k=0;k<p_Nq;++k;@inner(1)){
for(int j=0;j<p_Nq;++j;@inner(0)){
for(int i=0;i<p_Nq;++i){
const dlong id = e*p_Np+k*p_Nq*p_Nq+j*p_Nq+i;
const dlong base = e*p_Nggeo*p_Np + k*p_Nq*p_Nq + j*p_Nq + i;

Expand All @@ -175,9 +175,9 @@ SOFTWARE.
@barrier("local");

// loop over slabs
for(int k=0;k<p_Nq;++k;@inner(2)){
for(int j=0;j<p_Nq;++j;@inner(1)){
for(int i=0;i<p_Nq;++i;@inner(0)){
for(int k=0;k<p_Nq;++k;@inner(1)){
for(int j=0;j<p_Nq;++j;@inner(0)){
for(int i=0;i<p_Nq;++i){
const dlong id = e*p_Np+k*p_Nq*p_Nq+j*p_Nq+i;
if(r_masked){
r_q = 0.f; // first make it zero
Expand Down Expand Up @@ -239,9 +239,9 @@ SOFTWARE.
@shared dfloat s_Gss[p_Nq][p_Nq][p_Nq];
@shared dfloat s_Gtt[p_Nq][p_Nq][p_Nq];
// prefetch lamda 0
for(int k=0;k<p_Nq;++k;@inner(2)){
for(int j=0;j<p_Nq;++j;@inner(1)){
for(int i=0;i<p_Nq;++i;@inner(0)){
for(int k=0;k<p_Nq;++k;@inner(1)){
for(int j=0;j<p_Nq;++j;@inner(0)){
for(int i=0;i<p_Nq;++i){
const dlong id = e*p_Np+k*p_Nq*p_Nq+j*p_Nq+i;
const dlong base = e*p_Nggeo*p_Np + k*p_Nq*p_Nq + j*p_Nq + i;

Expand All @@ -263,9 +263,9 @@ SOFTWARE.
@barrier("local");

// loop over slabs
for(int k=0;k<p_Nq;++k;@inner(2)){
for(int j=0;j<p_Nq;++j;@inner(1)){
for(int i=0;i<p_Nq;++i;@inner(0)){
for(int k=0;k<p_Nq;++k;@inner(1)){
for(int j=0;j<p_Nq;++j;@inner(0)){
for(int i=0;i<p_Nq;++i){
const dlong id = e*p_Np+k*p_Nq*p_Nq+j*p_Nq+i;
dfloat r_q = 1.0f;

Expand Down