-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from LLNL/faster-compile
faster compile
- Loading branch information
Showing
12 changed files
with
90 additions
and
53 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
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
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
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,71 @@ | ||
/* | ||
Copyright (c) 2016-18, Lawrence Livermore National Security, LLC. | ||
Produced at the Lawrence Livermore National Laboratory | ||
Maintained by Tom Scogland <[email protected]> | ||
CODE-756261, All rights reserved. | ||
This file is part of camp. | ||
For details about use and distribution, please read LICENSE and NOTICE from | ||
http://github.com/llnl/camp | ||
*/ | ||
|
||
#include <camp/camp.hpp> | ||
#include <stdexcept> | ||
#include <string> | ||
#include <exception> | ||
|
||
|
||
namespace camp | ||
{ | ||
|
||
void throw_re(const char *s) { throw std::runtime_error(s); } | ||
|
||
#ifdef CAMP_ENABLE_CUDA | ||
|
||
|
||
cudaError_t cudaAssert(cudaError_t code, | ||
const char *call, | ||
const char *file, | ||
int line) | ||
{ | ||
if (code != cudaSuccess && code != cudaErrorNotReady) { | ||
std::string msg; | ||
msg += "campCudaErrchk("; | ||
msg += call; | ||
msg += ") "; | ||
msg += cudaGetErrorString(code); | ||
msg += " "; | ||
msg += file; | ||
msg += ":"; | ||
msg += std::to_string(line); | ||
throw std::runtime_error(msg); | ||
} | ||
return code; | ||
} | ||
|
||
#endif //#ifdef CAMP_ENABLE_CUDA | ||
|
||
#ifdef CAMP_ENABLE_HIP | ||
|
||
hipError_t hipAssert(hipError_t code, | ||
const char *call, | ||
const char *file, | ||
int line) | ||
{ | ||
if (code != hipSuccess && code != hipErrorNotReady) { | ||
std::string msg; | ||
msg += "campHipErrchk("; | ||
msg += call; | ||
msg += ") "; | ||
msg += hipGetErrorString(code); | ||
msg += " "; | ||
msg += file; | ||
msg += ":"; | ||
msg += std::to_string(line); | ||
throw std::runtime_error(msg); | ||
} | ||
return code; | ||
} | ||
|
||
#endif //#ifdef CAMP_ENABLE_HIP | ||
|
||
} // namespace camp |