forked from rapidsai/cuml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(1) warning|erros handling more accurate via logging it. (2) logging infrastructure to log (3) logging configuration (4) compiler specific macroses to handle compiler-relative information (4) append unittests to test logging (5) append doxygen documentation (6) append (in #if 0) examples of usage into pcaFit (7) minor changes in README.md (8) some changes in CMakeLists.txt relative to way how enumerate source and link libraries
- Loading branch information
1 parent
18f715f
commit 5dc14b9
Showing
15 changed files
with
1,120 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
*.swp | ||
|
||
cuML-build/ | ||
cuml/build/ | ||
|
||
ml-prims-build/ | ||
ml-prims/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2018, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** @file | ||
* Architecture specific macroses | ||
* Information to make I took from http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system | ||
*/ | ||
|
||
#pragma once | ||
|
||
#if defined(__ia64) || defined(__itanium__) || defined(_M_IA64) | ||
#define RAPIDS_ARCH_NAME "Itanium" | ||
#define RAPIDS_ARCH_ITANIUM 1 | ||
#define RAPIDS_ARCH_LITTLE_ENDIAN 1 | ||
#define RAPIDS_ARCH_BIG_ENDIAN 0 | ||
|
||
#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) | ||
#if defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__64BIT__) || defined(_LP64) || defined(__LP64__) | ||
#define RAPIDS_ARCH_NAME "Power pc 64" | ||
#define RAPIDS_ARCH_POWER_PC_64 1 | ||
#else | ||
#define RAPIDS_ARCH_NAME "Power pc 32" | ||
#define RAPIDS_ARCH_POWER_PC_32 1 | ||
#endif | ||
#elif defined(__sparc) | ||
#define RAPIDS_ARCH_NAME "Sparc" | ||
#define RAPIDS_ARCH_SPARC 1 | ||
#define RAPIDS_ARCH_LITTLE_ENDIAN 0 | ||
#define RAPIDS_ARCH_BIG_ENDIAN 1 | ||
#elif defined(__x86_64__) || defined(_M_X64) | ||
#define RAPIDS_ARCH_NAME "AMD, Intel x86 64 bit" | ||
#define RAPIDS_ARCH_X86_64BIT 1 | ||
#define RAPIDS_ARCH_LITTLE_ENDIAN 1 | ||
#define RAPIDS_ARCH_BIG_ENDIAN 0 | ||
#elif defined(__i386) || defined(_M_IX86) | ||
#define RAPIDS_ARCH_NAME "AMD, Intel x86 32 bit" | ||
#define RAPIDS_ARCH_X86_32BIT 1 | ||
#define RAPIDS_ARCH_LITTLE_ENDIAN 1 | ||
#define RAPIDS_ARCH_BIG_ENDIAN 0 | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (c) 2018, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cuda_runtime_api.h> | ||
#include <cublas_v2.h> | ||
|
||
#include <string> | ||
|
||
namespace ML | ||
{ | ||
namespace Utils | ||
{ | ||
template<class T> | ||
inline bool isSuccessStatus(const T& arg); | ||
template<class T> | ||
inline std::string unSuccessReason(const T& arg); | ||
|
||
//===============CUBLAS RELATIVE STATUSES START=================================================== | ||
template<> | ||
inline bool isSuccessStatus(const cublasStatus_t& arg) { | ||
return arg != CUBLAS_STATUS_SUCCESS; | ||
} | ||
template<> | ||
inline std::string unSuccessReason(const cublasStatus_t& arg) { | ||
switch (arg) | ||
{ | ||
case CUBLAS_STATUS_SUCCESS : return "CUBLAS_STATUS_SUCCESS"; | ||
case CUBLAS_STATUS_NOT_INITIALIZED : return "CUBLAS_STATUS_NOT_INITIALIZED"; | ||
case CUBLAS_STATUS_ALLOC_FAILED : return "CUBLAS_STATUS_ALLOC_FAILED"; | ||
case CUBLAS_STATUS_INVALID_VALUE : return "CUBLAS_STATUS_INVALID_VALUE"; | ||
case CUBLAS_STATUS_ARCH_MISMATCH : return "CUBLAS_STATUS_ARCH_MISMATCH"; | ||
case CUBLAS_STATUS_MAPPING_ERROR : return "CUBLAS_STATUS_MAPPING_ERROR"; | ||
case CUBLAS_STATUS_EXECUTION_FAILED : return "CUBLAS_STATUS_EXECUTION_FAILED"; | ||
case CUBLAS_STATUS_INTERNAL_ERROR : return "CUBLAS_STATUS_INTERNAL_ERROR"; | ||
case CUBLAS_STATUS_NOT_SUPPORTED : return "CUBLAS_STATUS_NOT_SUPPORTED"; | ||
case CUBLAS_STATUS_LICENSE_ERROR : return "CUBLAS_STATUS_LICENSE_ERROR"; | ||
} | ||
return "Uknown"; | ||
} | ||
//===============CUBLAS RELATIVE STATUSES END=================================================== | ||
|
||
//===============CUDA RELATIVE STATUSES START=================================================== | ||
template<> | ||
inline bool isSuccessStatus(const cudaError_t& arg) { | ||
return arg != cudaSuccess; | ||
} | ||
template<> | ||
inline std::string unSuccessReason(const cudaError_t& arg) { | ||
return std::string(cudaGetErrorString(arg)); | ||
} | ||
//===============CUDA RELATIVE STATUSES END===================================================== | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (c) 2018, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** @file | ||
* Compiler-specific macroses | ||
* The most part of thiswas taken from http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "utils/info/HelpMacroses.h" | ||
|
||
#if defined(__clang__) | ||
#define RAPIDS_COMPILER_NAME "Clang/LLVM" | ||
#define RAPIDS_COMPILER_VERSION_STRING_LONG __VERSION__ | ||
#define RAPIDS_COMPILER_IS_CLANG | ||
#define RAPIDS_FUNCTION_NAME __FUNCTION__ | ||
#elif defined(__ICC) || defined(__INTEL_COMPILER) | ||
#define RAPIDS_COMPILER_NAME "Intel ICC/ICPC" | ||
#define RAPIDS_COMPILER_VERSION_STRING_LONG __VERSION__ | ||
#define RAPIDS_COMPILER_IS_INTEL | ||
#define RAPIDS_FUNCTION_NAME __FUNCTION__ | ||
#elif defined(__GNUC__) || defined(__GNUG__) | ||
#define RAPIDS_COMPILER_NAME "GNU GCC/G++" | ||
#define RAPIDS_COMPILER_VERSION_STRING_LONG __VERSION__ | ||
#define RAPIDS_COMPILER_IS_GCC | ||
#define RAPIDS_FUNCTION_NAME __PRETTY_FUNCTION__ | ||
#elif defined(__HP_cc) || defined(__HP_aCC) | ||
#define RAPIDS_COMPILER_NAME "Hewlett-Packard C/aC++" | ||
#define RAPIDS_COMPILER_VERSION_STRING_LONG RAPIDS_STRINGIZING(__HP_aCC) | ||
#define RAPIDS_COMPILER_IS_HP | ||
#define RAPIDS_FUNCTION_NAME __FUNCTION__ | ||
#elif defined(__IBMC__) || defined(__IBMCPP__) | ||
#define RAPIDS_COMPILER_NAME "IBM XL C/C++" | ||
#define RAPIDS_COMPILER_VERSION_STRING_LONG __xlc__ | ||
#define RAPIDS_COMPILER_IS_IBM | ||
#define RAPIDS_FUNCTION_NAME __FUNCTION__ | ||
#elif defined(_MSC_VER) | ||
#error "RAPIDS is not supported for building under Windows and any Windows platform compilers" | ||
#elif defined(__PGI) | ||
#define RAPIDS_COMPILER_NAME "Portland Group PGCC/PGCPP" | ||
#define RAPIDS_COMPILER_VERSION_STRING_LONG RAPIDS_STRINGIZING(__PGIC__) "." RAPIDS_STRINGIZING(__PGIC_MINOR) "." RAPIDS_STRINGIZING(__PGIC_PATCHLEVEL__) | ||
#define RAPIDS_COMPILER_IS_PGI | ||
#define RAPIDS_FUNCTION_NAME __FUNCTION__ | ||
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) | ||
#define RAPIDS_COMPILER_NAME "Oracle Solaris Studio" | ||
#define RAPIDS_COMPILER_VERSION_STRING_LONG RAPIDS_STRINGIZING(__SUNPRO_CC) | ||
#define RAPIDS_COMPILER_IS_ORACLE | ||
#define RAPIDS_FUNCTION_NAME __FUNCTION__ | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2018, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
/** Stringizing of exprtession without evaluate it in compiler time | ||
* @param expr expression which you would not be evaluated in compile-time and then stringinized | ||
*/ | ||
#define RAPIDS_STRINGIZING_NO_EVAL_EXPRESSION(expr) #expr | ||
|
||
/** Stringizing. Text which will be checked for macro expansion and arithmeitc operations during compile-time, and then stringinized | ||
* @param expr expression which you want to evaluate in compile-time and then stringinized | ||
*/ | ||
#define RAPIDS_STRINGIZING(expr) RAPIDS_STRINGIZING_NO_EVAL_EXPRESSION(expr) |
Oops, something went wrong.