Sfoglia il codice sorgente

Fix build with older versions of CUDA

Samuel Thibault 8 anni fa
parent
commit
12707389d9
1 ha cambiato i file con 11 aggiunte e 1 eliminazioni
  1. 11 1
      examples/sched_ctx/axpy_partition_gpu.h

+ 11 - 1
examples/sched_ctx/axpy_partition_gpu.h

@@ -88,7 +88,17 @@ if(block_start > active_blocks)						\
 
 template <typename F>
 static void buildPartitionedBlockMapping(F cudaFun, int threads, int shmem, int mapping_start, int allocation,
-				  int &width, int &active_blocks, unsigned int *block_assignment_d,cudaStream_t current_stream = cudaStreamPerThread)
+				  int &width, int &active_blocks, unsigned int *block_assignment_d,cudaStream_t current_stream =
+#ifdef cudaStreamPerThread
+				  cudaStreamPerThread
+#elif defined(cudaStreamNonBlocking)
+				  cudaStreamNonBlocking
+#elif defined(cudeStreamDefault)
+				  cudaStreamDefault
+#else
+				  NULL
+#endif
+				  )
 {
   int occupancy;
   int nb_SM = 13; //TODO: replace with call