 	  // create array of random numbers: we need num_subboots*num_bins random numbers
 	  
  	  curandGenerator_t gen;
-		//cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_subboots) * sizeof(float)));
-	  cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_subboots) * sizeof(unsigned int)));
+if (BSTRAP==3) cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_boots) * sizeof(unsigned int)));
+else  cudaSafeCall(cudaMalloc((void**)&d_irand,  (num_bins)*(num_subboots) * sizeof(unsigned int)));
+
 	  curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT);
 	  curandSetPseudoRandomGeneratorSeed(gen, 1234ULL);
-	    //curandGenerateUniform(gen, d_irand, (num_bins)*(num_subboots));
-      curandGenerate(gen, d_irand, (num_bins)*(num_subboots));
+if (BSTRAP==3) 	curandGenerate(gen, d_irand, (num_bins)*(num_boots));
+else curandGenerate(gen, d_irand, (num_bins)*(num_subboots));
 	  cudaSafeCall( cudaDeviceSynchronize() );
 
 	  timeSinceLastTimer = elapsed_time(&gpu_timer);

	  cudaSafeCall(cudaMemcpy(d_odata2, bin_array, sizeof(float)*num_bins, cudaMemcpyHostToDevice));

	cudaSafeCall( cudaDeviceSynchronize() );
	bootstrap<<<num_blocks,num_threadsperblock>>>(d_idata2, d_odata2, d_irand);
	//bootstrap2<<num_blocks,num_threadsperblock>>(d_idata2,d_odata2,d_irand);
	//bootstrap3<<num_blocks,num_threadsperblock>>(d_idata2,d_odata2,d_irand);
	cudaCheckMsg("bootstrap kernel execution failed");
	cudaSafeCall( cudaDeviceSynchronize() );
	gpu_calcs = elapsed_time(&gpu_timer);

#include <omp.h>

#define TBS 256 //this is the threads per block for the jackknife reduction kernel
#define ELS 10240000 //number of elements
#define NTHREADS 13 //only valid for Open MP Jackknife, dependent on the system number of cores available
#define EPB 128 //elements per bin in bootstrap
#define ELPB 128 //threads per block (elements per bootstrap) in bootstrap
#define BOOTS 16384 //number of bootstraps
// see main() below for what happens when each of the following is 0/1
#define CPU_JACK 0
#define OMP_JACK 0
#define GPU_JACK 0
#define CPU_BOOT 1
#define LOOP_BOOT 0 //loop_boot=1 and gpu_boot=1 causes us to loop over different bin sizes
#define GPU_BOOT 1
#define BSTRAP 1 //this is which bootstrap method we run, 1 is the quickest but has some bias, 3 is slowest and has no bias, 2 is between 1 and 3.



