Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging

Conflicts:
	include/hcc_detail/trace_helper.h
This commit is contained in:
Ben Sander
2016-03-29 05:56:03 -05:00
6 changed files with 49 additions and 27 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ class ihipDevice_t;
// #include CPP files to produce one object file
#define ONE_OBJECT_FILE 1
#define ONE_OBJECT_FILE 0
// Compile support for trace markers that are displayed on CodeXL GUI at start/stop of each function boundary.
+11 -7
View File
@@ -16,7 +16,7 @@ LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#pragma once
#include <iostream>
#include <iomanip>
@@ -35,7 +35,7 @@ THE SOFTWARE.
// Building block functions:
template <typename T>
std::string ToHexString(T v)
inline std::string ToHexString(T v)
{
std::ostringstream ss;
ss << "0x" << std::hex << v;
@@ -48,7 +48,7 @@ std::string ToHexString(T v)
// This is the default which works for most types:
template <typename T>
std::string ToString(T v)
inline std::string ToString(T v)
{
std::ostringstream ss;
ss << v;
@@ -77,7 +77,8 @@ std::string ToString(hipStream_t v)
// hipMemcpyKind specialization
template <>
std::string ToString(hipMemcpyKind v) {
inline std::string ToString(hipMemcpyKind v)
{
switch(v) {
CASE_STR(hipMemcpyHostToHost);
CASE_STR(hipMemcpyHostToDevice);
@@ -90,13 +91,15 @@ std::string ToString(hipMemcpyKind v) {
template <>
std::string ToString(hipError_t v) {
inline std::string ToString(hipError_t v)
{
return ihipErrorString(v);
};
// Catch empty arguments case
std::string ToString() {
inline std::string ToString()
{
return ("");
}
@@ -105,6 +108,7 @@ std::string ToString() {
// C++11 variadic template - peels off first argument, converts to string, and calls itself again to peel the next arg.
// Strings are automatically separated by comma+space.
template <typename T, typename... Args>
std::string ToString(T first, Args... args) {
inline std::string ToString(T first, Args... args)
{
return ToString(first) + ", " + ToString(args...) ;
}