argonne-lcf / GettingStarted

Collection of small examples for running on ALCF resources
16 stars 7 forks source link

Modifying SYCL affinity example to remove LZ dependence #26

Closed colleeneb closed 5 months ago

colleeneb commented 5 months ago

The GPU affinity example for SYCL for Aurora was getting the GPU UUIDs by invoking Level Zero. Instead of using that, we can now use an intel extension to SYCL and get the UUIDs in a simpler manner. The benefit of this is: 1) less code, 2) this will also execute correctly on Polaris as well (I tested it) so people can run the exact same on Nvidia systems with SYCL as well, and 3) for users that want to print the UUID from their own code, this is a much simpler way than using Level Zero, so they could copy and paste from here.

The output is nearly the same, but the characters in the UUIDs are flipped. The uuid_print function here is the same as that in other examples in the Polaris directory for this repo, like Polaris/affinity_gpu/main.cpp and Polaris/ensemble/main.cpp, so I liked using it to be consistent. I don't know if it matters too much as long as we have unique IDs but I can edit it to match the previous one if people prefer. (I liked the new version since it puts the "1" and "2" to designate which tile it is at the end of the string instead of the start.)

Previously:

With this branch:

Let me know if there are comments or questions or anything to improve!