fixed broken tests and device code for integer intrinsics

1. Fixed build issues with new Integer intrinsics
2. Changed tests to work exactly as CUDA code
3. Still some integer intrinsics need to be supported

Change-Id: Ie6f4171259cf4da517436895d4f6f01e01f59b11
This commit is contained in:
Aditya Atluri committed 2017-01-17 09:00:09 -06:00
1 parent b09ad764a1
commit c0fd0921cb
8 files changed
+23 -23

No files matched your search

@@ -20,6 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "hip/hip_runtime.h"
#include "hip/device_functions.h"
#include "test_common.h"
#pragma GCC diagnostic ignored "-Wall"
+9 -7
View File
@@ -26,9 +26,11 @@ THE SOFTWARE.
#include <iostream>
#include "hip/hip_runtime.h"
#include "hip/device_functions.h"
#define HIP_ASSERT(x) (assert((x)==hipSuccess))
__global__ void
__global__ void
gpu_ballot(hipLaunchParm lp, unsigned int* device_ballot, int Num_Warps_per_Block,int pshift)
{
@@ -39,7 +41,7 @@ __global__ void
#else
atomicAdd(&device_ballot[warp_num+hipBlockIdx_x*Num_Warps_per_Block],__popc(__ballot(tid - 245)));
#endif
}
@@ -47,24 +49,24 @@ int main(int argc, char *argv[])
{ int warpSize, pshift;
hipDeviceProp_t devProp;
hipGetDeviceProperties(&devProp, 0);
warpSize = devProp.warpSize;
int w = warpSize;
pshift = 0;
pshift = 0;
while (w >>= 1) ++pshift;
unsigned int Num_Threads_per_Block = 512;
unsigned int Num_Blocks_per_Grid = 1;
unsigned int Num_Warps_per_Block = Num_Threads_per_Block/warpSize;
unsigned int Num_Warps_per_Grid = (Num_Threads_per_Block*Num_Blocks_per_Grid)/warpSize;
unsigned int* host_ballot = (unsigned int*)malloc(Num_Warps_per_Grid*sizeof(unsigned int));
unsigned int* device_ballot;
unsigned int* device_ballot;
HIP_ASSERT(hipMalloc((void**)&device_ballot, Num_Warps_per_Grid*sizeof(unsigned int)));
int divergent_count =0;
for (int i=0; i<Num_Warps_per_Grid; i++) host_ballot[i] = 0;
HIP_ASSERT(hipMemcpy(device_ballot, host_ballot, Num_Warps_per_Grid*sizeof(unsigned int), hipMemcpyHostToDevice));
hipLaunchKernel(gpu_ballot, dim3(Num_Blocks_per_Grid),dim3(Num_Threads_per_Block),0,0, device_ballot,Num_Warps_per_Block,pshift);
+1 -2
View File
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <stdlib.h>
#include <iostream>
#include "hip/hip_runtime.h"
#include "hip/device_functions.h"
#define HIP_ASSERT(x) (assert((x)==hipSuccess))
@@ -181,4 +181,3 @@ int main() {
return errors;
}
+1 -1
View File
@@ -32,6 +32,7 @@ THE SOFTWARE.
#include <stdlib.h>
#include <iostream>
#include "hip/hip_runtime.h"
#include "hip/device_functions.h"
#define HIP_ASSERT(x) (assert((x)==hipSuccess))
#define WIDTH 8
@@ -188,4 +189,3 @@ int main() {
return errors;
}
+1 -2
View File
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <stdlib.h>
#include <iostream>
#include "hip/hip_runtime.h"
#include "hip/device_functions.h"
#define HIP_ASSERT(x) (assert((x)==hipSuccess))
@@ -184,4 +184,3 @@ int main() {
return errors;
}
+1 -2
View File
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <stdlib.h>
#include <iostream>
#include "hip/hip_runtime.h"
#include "hip/device_functions.h"
#define HIP_ASSERT(x) (assert((x)==hipSuccess))
@@ -172,4 +172,3 @@ int main() {
return errors;
}