diff options
author | Ivan Shapovalov <intelfx@intelfx.name> | 2016-07-02 02:38:48 +0300 |
---|---|---|
committer | Ivan Shapovalov <intelfx@intelfx.name> | 2016-08-27 05:37:26 +0300 |
commit | ea43936e94fdf2eabb913c1ebc1ac6143bde5bba (patch) | |
tree | 472e138c8e5d1ca1dc3612030fe775414662845d /test/correctness/tester.cpp | |
parent | 8d6a6a5bbf7811d7dff799ed8c1c12d63bca19db (diff) |
test/correctness: read platform and device from environment
Support passing environment variables CLBLAST_PLATFORM and CLBLAST_DEVICE
instead of -platform and -device arguments to test executables.
This is for `ctest`.
Diffstat (limited to 'test/correctness/tester.cpp')
-rw-r--r-- | test/correctness/tester.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/correctness/tester.cpp b/test/correctness/tester.cpp index 92e2c1b8..362c5c2c 100644 --- a/test/correctness/tester.cpp +++ b/test/correctness/tester.cpp @@ -15,6 +15,7 @@ #include <vector> #include <iostream> #include <cmath> +#include <cstdlib> #include "test/correctness/tester.hpp" @@ -27,8 +28,8 @@ template <typename T, typename U> Tester<T,U>::Tester(int argc, char *argv[], const bool silent, const std::string &name, const std::vector<std::string> &options): help_("Options given/available:\n"), - platform_(Platform(GetArgument(argc, argv, help_, kArgPlatform, size_t{0}))), - device_(Device(platform_, GetArgument(argc, argv, help_, kArgDevice, size_t{0}))), + platform_(Platform(GetArgument(argc, argv, help_, kArgPlatform, ConvertArgument(std::getenv("CLBLAST_PLATFORM"), size_t{0})))), + device_(Device(platform_, GetArgument(argc, argv, help_, kArgDevice, ConvertArgument(std::getenv("CLBLAST_DEVICE"), size_t{0})))), context_(Context(device_)), queue_(Queue(context_, device_)), full_test_(CheckArgument(argc, argv, help_, kArgFullTest)), |