Fix memcpy for Titan. Add <threads> to common includes

This commit is contained in:
Ben Sander
2016-02-22 15:09:23 -06:00
parent 16b04fc0d3
commit 784ebcbc86
3 changed files with 19 additions and 3 deletions
+10 -3
View File
@@ -63,6 +63,13 @@ void simpleTest1()
}
#ifdef __HIP_PLATFORM_HCC
#define TYPENAME(T) typeid(T).name()
#else
#define TYPENAME(T) "?"
#endif
//---
// Test many different kinds of memory copies.
// THe subroutine allocates memory , copies to device, runs a vector add kernel, copies back, and checks the result.
@@ -79,7 +86,7 @@ void memcpytest2(size_t numElements, bool usePinnedHost, bool useHostToHost, boo
size_t sizeElements = numElements * sizeof(T);
printf ("test: %s<%s> size=%lu (%6.2fMB) usePinnedHost:%d, useHostToHost:%d, useDeviceToDevice:%d, useMemkindDefault:%d\n",
__func__,
typeid(T).name(),
TYPENAME(T),
sizeElements, sizeElements/1024.0/1024.0,
usePinnedHost, useHostToHost, useDeviceToDevice, useMemkindDefault);
@@ -169,7 +176,7 @@ template<typename T>
void memcpytest2_sizes(size_t maxElem=0, size_t offset=0)
{
printSep();
printf ("test: %s<%s>\n", __func__, typeid(T).name());
printf ("test: %s<%s>\n", __func__, TYPENAME(T));
int deviceId;
HIPCHECK(hipGetDevice(&deviceId));
@@ -199,7 +206,7 @@ template<typename T>
void multiThread_1(bool serialize, bool usePinnedHost)
{
printSep();
printf ("test: %s<%s> serialize=%d usePinnedHost=%d\n", __func__, typeid(T).name(), serialize, usePinnedHost);
printf ("test: %s<%s> serialize=%d usePinnedHost=%d\n", __func__, TYPENAME(T), serialize, usePinnedHost);
std::thread t1 (memcpytest2<T>,N, usePinnedHost,0,0,0);
if (serialize) {
t1.join();