Giter Club home page Giter Club logo

Comments (2)

cosunae avatar cosunae commented on September 17, 2024

In a different example,

the diagnostics works:

/code/clang-gridtools_new/benchmarks/../src/dycore/horizontal_diffusion_type2_single.cpp:75:7: error: unresolvable race-condition in statement
      const double delta_flux_y =

but I think it should simply version data

stencil_function avg {
  offset off;
  storage in;

  Do { return 0.5 * (in[off] + in); }
};

stencil_function delta {
  offset off;
  storage data;

  Do { return data[off] - data; }
};

stencil_function laplacian {
  storage data, crlato, crlatv;

  Do {
    return data[i + 1] + data[i - 1] - 2.0 * data +
           crlato * delta(j + 1, data) + crlatv * delta(j - 1, data);
  }
};

stencil_function diffusive_flux_x {
  storage lap, data;

  Do {
    const double flx = delta(i + 1, lap);
    return (flx * delta(i + 1, data)) > 0.0 ? 0.0 : flx;
  }
};

stencil_function diffusive_flux_y {
  storage lap, data, crlato;

  Do {
    const double fly = crlato * delta(j + 1, lap);
    return (fly * delta(j + 1, data)) > 0.0 ? 0.0 : fly;
  }
};

stencil horizontal_diffusion_type2_single {
  storage data, crlato, crlatu, hdmask;
  var lap;

  Do {
    vertical_region(k_start, k_end) {
      lap = laplacian(data, crlato, crlatu);
      const double delta_flux_x = diffusive_flux_x(lap, data) -
                                  diffusive_flux_x(lap[i - 1], data[i - 1]);
      const double delta_flux_y =
          diffusive_flux_y(lap, data, crlato) -
          diffusive_flux_y(lap[j - 1], data[j - 1], crlato[j - 1]);
      data = data - hdmask * (delta_flux_x + delta_flux_y);
    }
  }
};

from dawn.

mroethlin avatar mroethlin commented on September 17, 2024

This still crashes as of 17.10.2019 / master: a8ded67

from dawn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.