 	}
 }
 
-#if __CUDACC_VER_MAJOR__ >= 9
+#if TEST_COOPERATIVE_GROUPS
 __global__ void grid_cooperating_foo(int bar)
 {
 #ifdef _CG_HAS_GRID_GROUP


			// Same, but using cuda::enqueue_launch
			std::cout
			<< "Launching kernel " << cooperative_kernel_name
				<< " wrapped in a kernel_t structure,"
				<< " with " << num_blocks << " blocks, using cuda::enqueue_launch(),"
				<< " and allowing thread block cooperation\n"

#include <cuda_runtime_api.h>

#if __CUDACC_VER_MAJOR__ >= 9
#define TEST_COOPERATIVE_GROUPS 1
#include <cooperative_groups.h>
#else
#define TEST_COOPERATIVE_GROUPS 0
#endif

#include <iostream>
