Determine and allocate all resources for the sampler */
| 958 | |
| 959 | /** Determine and allocate all resources for the sampler */ |
| 960 | void build() { |
| 961 | CUDA_CHECK(cudaSetDevice(device_id)); |
| 962 | |
| 963 | num_partition = solver->num_partition; |
| 964 | pool_size = solver->episode_size * solver->batch_size; |
| 965 | random.resize(kRandBatchSize); |
| 966 | CURAND_CHECK(curandGenerateUniformDouble(generator, random.device_ptr, kRandBatchSize)); |
| 967 | } |
| 968 | |
| 969 | /** Free GPU memory */ |
| 970 | void clear() { |