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

Node and Device Properties #3

Open
tdd11235813 opened this issue Mar 7, 2017 · 0 comments
Open

Node and Device Properties #3

tdd11235813 opened this issue Mar 7, 2017 · 0 comments

Comments

@tdd11235813
Copy link

tdd11235813 commented Mar 7, 2017

We run into the issue of a standardization process for hardware topologies and I think HSA can help us with names and layers.

What is the current state of compass. The current compass usage usually looks like this:

auto vendor = compass::runtime::vendor();
auto device_name = compass::runtime::device_name();
auto value = compass::runtime::has(compass::feature::sse());
...

The instantiation of the corresponding wrappers happens at compile-time through the detection of

  • OS (linux, mac, windows)
  • platform (x86, x86_64, power)
  • compiler architecture (clang, intel, gcc, msvc),

mostly retrieved by macros coming from header includes and compilers.

So, the code above always refer to CPU device (keep in mind, nvcc does not compile host code). So first thing coming up here is:

How to name device layer?

There is a need for a layer for the devices within a node. C++AMP just calls them accelerator, which does not seem sufficient for our library. What about HSA, what's their convention:

HSA nomenclature

1x compass instance only sees 1x node, but n devices (HSA refers to as agents).

// possible compass API
auto node = compass::node();
auto node_compiletime = compass::compiletime::node(); // for compile-time structure
auto vendor = compass::vendor(node);
  • So, how about using compass::node and compass::devices to get [compile-time] properties encapsulated in structures?

How to select or iterate through devices?

// possible compass API
...
auto devices = compass::devices();
auto value_node = compass::has(node, compass::feature::sse());
auto value_dev  = compass::has(devices[0], compass::feature::sse());
auto devices_gpu = compass::devices(compass::device_type::gpu);
...
  • maybe the runtime namespace can be neglected. A user should not start guessing "is this in runtime or in compiletime". However, compiletime could be a reasonable namespace to ensure compile-time features
  • does compile-time feature still work when using cross-compiler?
  • accessing device- or node-specific properties can be done via structures/methods, see issue Encapsulation of properties? #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant