2017-06-04 20:18:37 -05:00
|
|
|
/*
|
|
|
|
|
Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
THE SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* HIT_START
|
|
|
|
|
* BUILD: %t %s ../../test_common.cpp
|
2019-04-03 11:54:50 +05:30
|
|
|
* TEST: %t
|
2017-06-04 20:18:37 -05:00
|
|
|
* HIT_END
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "test_common.h"
|
|
|
|
|
|
|
|
|
|
enum SyncMode {
|
|
|
|
|
syncNone,
|
|
|
|
|
syncNullStream,
|
|
|
|
|
syncOtherStream,
|
|
|
|
|
syncMarkerThenOtherStream,
|
|
|
|
|
syncMarkerThenOtherNonBlockingStream,
|
|
|
|
|
syncDevice
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2018-03-12 11:29:03 +05:30
|
|
|
const char* syncModeString(int syncMode) {
|
2017-06-04 20:18:37 -05:00
|
|
|
switch (syncMode) {
|
|
|
|
|
case syncNone:
|
|
|
|
|
return "syncNone";
|
|
|
|
|
case syncNullStream:
|
|
|
|
|
return "syncNullStream";
|
|
|
|
|
case syncOtherStream:
|
|
|
|
|
return "syncOtherStream";
|
|
|
|
|
case syncMarkerThenOtherStream:
|
|
|
|
|
return "syncMarkerThenOtherStream";
|
|
|
|
|
case syncMarkerThenOtherNonBlockingStream:
|
|
|
|
|
return "syncMarkerThenOtherNonBlockingStream";
|
|
|
|
|
case syncDevice:
|
|
|
|
|
return "syncDevice";
|
|
|
|
|
default:
|
|
|
|
|
return "unknown";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2018-03-12 11:29:03 +05:30
|
|
|
void test(unsigned testMask, int* C_d, int* C_h, int64_t numElements, SyncMode syncMode,
|
|
|
|
|
bool expectMismatch) {
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
// This test sends a long-running kernel to the null stream, then tests to see if the
|
2017-06-05 00:41:18 -05:00
|
|
|
// specified synchronization technique is effective.
|
|
|
|
|
//
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
// Some syncMode are not expected to correctly sync (for example "syncNone"). in these
|
2017-06-05 00:41:18 -05:00
|
|
|
// cases the test sets expectMismatch and the check logic below will attempt to ensure that
|
|
|
|
|
// the undesired synchronization did not occur - ie ensure the kernel is still running and did
|
|
|
|
|
// not yet update the stop event. This can be tricky since if the kernel runs fast enough it
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
// may complete before the check. To prevent this, the addCountReverse has a count parameter
|
|
|
|
|
// which causes it to loop repeatedly, and the results are checked in reverse order.
|
2017-06-05 00:41:18 -05:00
|
|
|
//
|
|
|
|
|
// Tests with expectMismatch=true should ensure the kernel finishes correctly. This results
|
|
|
|
|
// are checked and we test to make sure stop event has completed.
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
|
2017-06-05 00:41:18 -05:00
|
|
|
if (!(testMask & p_tests)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2018-03-12 11:29:03 +05:30
|
|
|
printf("\ntest 0x%02x: syncMode=%s expectMismatch=%d\n", testMask, syncModeString(syncMode),
|
|
|
|
|
expectMismatch);
|
2017-06-04 20:18:37 -05:00
|
|
|
|
|
|
|
|
size_t sizeBytes = numElements * sizeof(int);
|
|
|
|
|
|
2018-03-12 11:29:03 +05:30
|
|
|
int count = 100;
|
2017-06-04 20:18:37 -05:00
|
|
|
int init0 = 0;
|
|
|
|
|
HIPCHECK(hipMemset(C_d, init0, sizeBytes));
|
2018-03-12 11:29:03 +05:30
|
|
|
for (int i = 0; i < numElements; i++) {
|
|
|
|
|
C_h[i] = -1; // initialize
|
2017-06-04 20:18:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hipStream_t otherStream = 0;
|
2018-03-12 11:29:03 +05:30
|
|
|
unsigned flags = (syncMode == syncMarkerThenOtherNonBlockingStream) ? hipStreamNonBlocking
|
|
|
|
|
: hipStreamDefault;
|
2017-06-04 20:18:37 -05:00
|
|
|
HIPCHECK(hipStreamCreateWithFlags(&otherStream, flags));
|
2017-06-05 00:41:18 -05:00
|
|
|
hipEvent_t stop, otherStreamEvent;
|
|
|
|
|
HIPCHECK(hipEventCreate(&stop));
|
|
|
|
|
HIPCHECK(hipEventCreate(&otherStreamEvent));
|
2017-06-04 20:18:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, numElements);
|
|
|
|
|
// Launch kernel into null stream, should result in C_h == count.
|
2018-03-12 11:29:03 +05:30
|
|
|
hipLaunchKernelGGL(HipTest::addCountReverse, dim3(blocks), dim3(threadsPerBlock), 0,
|
|
|
|
|
0 /*stream*/, static_cast<const int*>(C_d), C_h, numElements, count);
|
|
|
|
|
HIPCHECK(hipEventRecord(stop, 0 /*default*/));
|
2017-06-04 20:18:37 -05:00
|
|
|
|
|
|
|
|
switch (syncMode) {
|
|
|
|
|
case syncNone:
|
|
|
|
|
break;
|
|
|
|
|
case syncNullStream:
|
|
|
|
|
HIPCHECK(hipStreamSynchronize(0)); // wait on host for null stream:
|
|
|
|
|
break;
|
|
|
|
|
case syncOtherStream:
|
|
|
|
|
// Does this synchronize with the null stream?
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
HIPCHECK(hipStreamSynchronize(otherStream));
|
2017-06-04 20:18:37 -05:00
|
|
|
break;
|
|
|
|
|
case syncMarkerThenOtherStream:
|
|
|
|
|
case syncMarkerThenOtherNonBlockingStream:
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
|
2017-06-05 00:41:18 -05:00
|
|
|
// this may wait for NULL stream depending hipStreamNonBlocking flag above
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
HIPCHECK(hipEventRecord(otherStreamEvent, otherStream));
|
2017-06-05 00:41:18 -05:00
|
|
|
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
HIPCHECK(hipStreamSynchronize(otherStream));
|
2017-06-04 20:18:37 -05:00
|
|
|
break;
|
|
|
|
|
case syncDevice:
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
HIPCHECK(hipDeviceSynchronize());
|
2017-06-04 20:18:37 -05:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
assert(0);
|
|
|
|
|
};
|
|
|
|
|
|
2017-06-05 00:41:18 -05:00
|
|
|
hipError_t done = hipEventQuery(stop);
|
|
|
|
|
|
|
|
|
|
if (expectMismatch) {
|
2018-03-12 11:29:03 +05:30
|
|
|
assert(done == hipErrorNotReady);
|
2017-06-05 00:41:18 -05:00
|
|
|
} else {
|
2018-03-12 11:29:03 +05:30
|
|
|
assert(done == hipSuccess);
|
2017-06-05 00:41:18 -05:00
|
|
|
}
|
|
|
|
|
|
2017-06-04 20:18:37 -05:00
|
|
|
int mismatches = 0;
|
|
|
|
|
int expected = init0 + count;
|
2018-03-12 11:29:03 +05:30
|
|
|
for (int i = 0; i < numElements; i++) {
|
2017-06-04 20:18:37 -05:00
|
|
|
bool compareEqual = (C_h[i] == expected);
|
|
|
|
|
if (!compareEqual) {
|
2018-03-12 11:29:03 +05:30
|
|
|
mismatches++;
|
|
|
|
|
if (!expectMismatch) {
|
|
|
|
|
printf("C_h[%d] (%d) != %d\n", i, C_h[i], expected);
|
2017-06-04 20:18:37 -05:00
|
|
|
assert(C_h[i] == expected);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (expectMismatch) {
|
2018-03-12 11:29:03 +05:30
|
|
|
assert(mismatches > 0);
|
2017-06-04 20:18:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HIPCHECK(hipStreamDestroy(otherStream));
|
2017-06-05 00:41:18 -05:00
|
|
|
HIPCHECK(hipEventDestroy(stop));
|
|
|
|
|
HIPCHECK(hipEventDestroy(otherStreamEvent));
|
2017-06-04 20:18:37 -05:00
|
|
|
|
2017-06-05 00:41:18 -05:00
|
|
|
HIPCHECK(hipDeviceSynchronize());
|
2017-06-04 20:18:37 -05:00
|
|
|
|
2018-03-12 11:29:03 +05:30
|
|
|
printf("test: OK - %d mismatches (%6.2f%%)\n", mismatches,
|
|
|
|
|
((double)(mismatches)*100.0) / numElements);
|
2017-06-04 20:18:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-03-12 11:29:03 +05:30
|
|
|
void runTests(int64_t numElements) {
|
2017-06-04 20:18:37 -05:00
|
|
|
size_t sizeBytes = numElements * sizeof(int);
|
|
|
|
|
|
2018-03-12 11:29:03 +05:30
|
|
|
printf("\n\ntest: starting sequence with sizeBytes=%zu bytes, %6.2f MB\n", sizeBytes,
|
|
|
|
|
sizeBytes / 1024.0 / 1024.0);
|
2017-06-04 20:18:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
int *C_h, *C_d;
|
|
|
|
|
HIPCHECK(hipMalloc(&C_d, sizeBytes));
|
|
|
|
|
HIPCHECK(hipHostMalloc(&C_h, sizeBytes));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2018-03-12 11:29:03 +05:30
|
|
|
test(0x01, C_d, C_h, numElements, syncNone, true /*expectMismatch*/);
|
|
|
|
|
test(0x02, C_d, C_h, numElements, syncNullStream, false /*expectMismatch*/);
|
2019-05-20 02:13:30 -04:00
|
|
|
#ifndef __HIP_CLANG_ONLY__
|
2018-03-12 11:29:03 +05:30
|
|
|
test(0x04, C_d, C_h, numElements, syncOtherStream, true /*expectMismatch*/);
|
2019-05-20 02:13:30 -04:00
|
|
|
#endif
|
2018-03-12 11:29:03 +05:30
|
|
|
test(0x08, C_d, C_h, numElements, syncDevice, false /*expectMismatch*/);
|
2017-06-05 00:41:18 -05:00
|
|
|
|
|
|
|
|
// Sending a marker to to null stream may synchronize the otherStream
|
|
|
|
|
// - other created with hipStreamNonBlocking=0 : synchronization, should match
|
|
|
|
|
// - other created with hipStreamNonBlocking=1 : no synchronization, may mismatch
|
2018-03-12 11:29:03 +05:30
|
|
|
test(0x10, C_d, C_h, numElements, syncMarkerThenOtherStream, false /*expectMismatch*/);
|
2017-06-05 00:41:18 -05:00
|
|
|
|
|
|
|
|
// TODO - review why this test seems flaky
|
2018-03-12 11:29:03 +05:30
|
|
|
// test (0x20, C_d, C_h, numElements, syncMarkerThenOtherNonBlockingStream, true
|
|
|
|
|
// /*expectMismatch*/);
|
2017-06-04 20:18:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HIPCHECK(hipFree(C_d));
|
|
|
|
|
HIPCHECK(hipHostFree(C_h));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-03-12 11:29:03 +05:30
|
|
|
int main(int argc, char* argv[]) {
|
2017-06-05 00:41:18 -05:00
|
|
|
// Can' destroy the default stream:// TODO - move to another test
|
This switches HIP from its currently convoluted macro + pfe based dispatch mechanism to a more natural one partially based on the existing module API. The basic idea is that HCC will always correctly emit __global__ functions: as empty-bodied stubs, on host, and as kernels, on device. It then becomes trivial to obtain the mangled name on host, at dispatch, from the function's address, and then to use the mangled name to retrieve the kernel. This should address all problems stemming from serialisation, dubious mismatches due to the manufactured functor, macro-isms et al. It also immediately enables support for generalised globals as a consequence of that being available in the module API. Finally, it will make debug much easier, since the actual names of the __global__ functions will automatically be used in traces etc. One detail is that due to how dispatch works now (hipLaunchKernel and hipLaunchKernelGGL are themselves variadic function templates which deduce the function type of the callee), in certain cases it may be necesssary to insert explicit casts to ensure that the variadic argument list selects a viable overload - this can be observed in some unit tests. Eventually we may be able to remove this limitation, but for now it does not appear terribly onerous. The code is not extremely HIPpie, nor is it fully optimised, but rather is intended as a starting point for the HIP team to make its own.
2017-11-01 15:09:59 +00:00
|
|
|
HIPCHECK_API(hipStreamDestroy(0), hipErrorInvalidResourceHandle);
|
2017-06-05 00:41:18 -05:00
|
|
|
|
2017-06-04 20:18:37 -05:00
|
|
|
HipTest::parseStandardArguments(argc, argv, true /*failOnUndefinedArg*/);
|
|
|
|
|
|
|
|
|
|
runTests(40000000);
|
|
|
|
|
|
|
|
|
|
passed();
|
|
|
|
|
}
|