summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCNugteren <web@cedricnugteren.nl>2016-01-30 14:57:49 +0100
committerCNugteren <web@cedricnugteren.nl>2016-01-30 14:57:49 +0100
commit9622d3be22d062765a39e664725e9aad42f62014 (patch)
tree1ddd497871f0f838a4e07d590e028225d70acedc
parent44fb40e5c464a532d683352b73123c77d1a5a9f7 (diff)
Fixes for compilation under Visual Studio
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/Modules/FindclBLAS.cmake2
-rw-r--r--src/utilities.cc9
-rw-r--r--test/correctness/testblas.cc2
4 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc4a9ddd..74b1e9b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,6 +57,7 @@ endif()
# C++ compiler settings
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(FLAGS "/Ox")
+ set(FLAGS "${FLAGS} /wd4715")
else ()
set(FLAGS "-O3 -std=c++11")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
diff --git a/cmake/Modules/FindclBLAS.cmake b/cmake/Modules/FindclBLAS.cmake
index be6f8af4..6a153de9 100644
--- a/cmake/Modules/FindclBLAS.cmake
+++ b/cmake/Modules/FindclBLAS.cmake
@@ -45,7 +45,7 @@ mark_as_advanced(CLBLAS_INCLUDE_DIRS)
find_library(CLBLAS_LIBRARIES
NAMES clBLAS
HINTS ${CLBLAS_HINTS}
- PATH_SUFFIXES lib lib64 lib/x86_64 lib/x64 lib/x86 lib/Win32
+ PATH_SUFFIXES lib lib64 lib/x86_64 lib/x64 lib/x86 lib/Win32 lib/import lib64/import
PATHS ${CLBLAS_PATHS}
DOC "clBLAS library"
)
diff --git a/src/utilities.cc b/src/utilities.cc
index 042b3116..24efb14c 100644
--- a/src/utilities.cc
+++ b/src/utilities.cc
@@ -103,7 +103,13 @@ std::string ToString(Precision value) {
// both the real and imaginary parts.
template <typename T>
T ConvertArgument(const char* value) {
- return static_cast<T>(std::stod(value));
+ return static_cast<T>(std::stoi(value));
+}
+template <> float ConvertArgument(const char* value) {
+ return static_cast<float>(std::stod(value));
+}
+template <> double ConvertArgument(const char* value) {
+ return static_cast<double>(std::stod(value));
}
template <> float2 ConvertArgument(const char* value) {
auto val = static_cast<float>(std::stod(value));
@@ -139,7 +145,6 @@ T GetArgument(const int argc, char *argv[], std::string &help,
}
// Compiles the above function
-template bool GetArgument<bool>(const int, char **, std::string&, const std::string&, const bool);
template int GetArgument<int>(const int, char **, std::string&, const std::string&, const int);
template size_t GetArgument<size_t>(const int, char **, std::string&, const std::string&, const size_t);
template float GetArgument<float>(const int, char **, std::string&, const std::string&, const float);
diff --git a/test/correctness/testblas.cc b/test/correctness/testblas.cc
index 85e18381..febd7504 100644
--- a/test/correctness/testblas.cc
+++ b/test/correctness/testblas.cc
@@ -35,7 +35,7 @@ TestBlas<T,U>::TestBlas(int argc, char *argv[], const bool silent,
const Routine run_routine, const Routine run_reference,
const ResultGet get_result, const ResultIndex get_index,
const ResultIterator get_id1, const ResultIterator get_id2):
- Tester<T,U>{argc, argv, silent, name, options},
+ Tester<T,U>(argc, argv, silent, name, options),
run_routine_(run_routine),
run_reference_(run_reference),
get_result_(get_result),