-
Notifications
You must be signed in to change notification settings - Fork 794
[SYCL][CUDA] Minor fixes required to run BabelStream benchmarks on CUDA #1543
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
Changes from 4 commits
1757da8
aa384ae
f910c93
195414f
5f611cb
09b9859
a907581
ac3b6f8
70a3e08
a659354
17480e0
66810be
ad3951c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ class plugin { | |
| public: | ||
| plugin() = delete; | ||
|
|
||
| plugin(RT::PiPlugin Plugin) : MPlugin(Plugin) { | ||
| explicit plugin(RT::PiPlugin Plugin) : MPlugin(Plugin) { | ||
| MPiEnableTrace = (std::getenv("SYCL_PI_TRACE") != nullptr); | ||
| } | ||
|
|
||
|
|
@@ -79,6 +79,17 @@ class plugin { | |
| bool MPiEnableTrace; | ||
|
|
||
| }; // class plugin | ||
|
|
||
| /// Two plugins are the same if their string is the same. | ||
| /// There is no need to check the actual string, just the pointer, since | ||
| /// there is only one instance of the PiPlugin struct per backend. | ||
| /// | ||
| /// \ingroup sycl_pi | ||
| /// | ||
| inline bool operator==(const plugin &lhs, const plugin &rhs) { | ||
| return (lhs.getPiPlugin().PluginVersion == rhs.getPiPlugin().PluginVersion); | ||
|
||
| } | ||
|
|
||
| } // namespace detail | ||
| } // namespace sycl | ||
| } // __SYCL_INLINE_NAMESPACE(cl) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,14 +43,16 @@ int default_selector::operator()(const device &dev) const { | |
| const platform platform = dev.get_info<info::device::platform>(); | ||
| const std::string platformVersion = | ||
| platform.get_info<info::platform::version>();; | ||
| const bool HasCudaString = | ||
| platformVersion.find("CUDA") != std::string::npos; | ||
| const bool HasOpenCLString = | ||
| platformVersion.find("OpenCL") != std::string::npos; | ||
| // If using PI_CUDA, don't accept a non-CUDA device | ||
| if (platformVersion.find("CUDA") == std::string::npos && | ||
| backend == "PI_CUDA") { | ||
| if (HasCudaString && HasOpenCLString && backend == "PI_CUDA") { | ||
|
||
| return -1; | ||
| } | ||
| // If using PI_OPENCL, don't accept a non-OpenCL device | ||
| if (platformVersion.find("OpenCL") == std::string::npos && | ||
| backend == "PI_OPENCL") { | ||
| if (HasCudaString && !HasOpenCLString && backend == "PI_OPENCL") { | ||
| return -1; | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.