MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / checkOrder

Function checkOrder

cpp/0_Introduction/mergeSort/mergeSort_host.cpp:38–49  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Helper functions ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

36// Helper functions
37////////////////////////////////////////////////////////////////////////////////
38static void checkOrder(uint *data, uint N, uint sortDir)
39{
40 if (N <= 1) {
41 return;
42 }
43
44 for (uint i = 0; i < N - 1; i++)
45 if ((sortDir && (data[i] > data[i + 1])) || (!sortDir && (data[i] < data[i + 1]))) {
46 fprintf(stderr, "checkOrder() failed!!!\n");
47 exit(EXIT_FAILURE);
48 }
49}
50
51static uint umin(uint a, uint b) { return (a <= b) ? a : b; }
52

Callers 1

mergeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected