summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-10-15 17:41:44 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-10-15 17:41:44 +0200
commit71049e8d3966ac58263355a41abb4eac5dec818f (patch)
treef4db019c428c4579939be01fda11e3a320191881 /src
parenta3069a97c3e5c22635786870c8a9d02ca16d3d1d (diff)
Added the SM-compute-arch version to the nv compile options
Diffstat (limited to 'src')
-rw-r--r--src/cupp11.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cupp11.hpp b/src/cupp11.hpp
index 5b18d4cf..2a54ef95 100644
--- a/src/cupp11.hpp
+++ b/src/cupp11.hpp
@@ -272,6 +272,11 @@ public:
const auto minor = GetInfo(CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR);
return "SM"+std::to_string(major)+"."+std::to_string(minor);
}
+ std::string ComputeArch() const {
+ const auto major = GetInfo(CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR);
+ const auto minor = GetInfo(CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR);
+ return "compute_"+std::to_string(major)+std::to_string(minor);
+ }
bool HasExtension(const std::string &extension) const { return false; }
bool SupportsFP64() const { return true; }
bool SupportsFP16() const {
@@ -396,7 +401,8 @@ public:
}
// Compiles the device program and checks whether or not there are any warnings/errors
- void Build(const Device &, std::vector<std::string> &options) {
+ void Build(const Device &device, std::vector<std::string> &options) {
+ options.push_back("-arch=" + device.ComputeArch());
if (from_binary_) { return; }
auto raw_options = std::vector<const char*>();
for (const auto &option: options) {