| 4587 | } |
| 4588 | |
| 4589 | clfftStatus FFTPlan::ConstructAndEnqueueConstantBuffers( cl_command_queue* commQueueFFT ) |
| 4590 | { |
| 4591 | // Construct the constant buffer and call clEnqueueWriteBuffer |
| 4592 | // |
| 4593 | cb_t ConstantBufferParams [CLFFT_CB_SIZE]; |
| 4594 | memset (& ConstantBufferParams, 0, sizeof (ConstantBufferParams)); |
| 4595 | |
| 4596 | ConstantBufferParams[0].u = std::max<cl_uint> (1, cl_uint (/*fftPlan->*/batchsize)); |
| 4597 | |
| 4598 | |
| 4599 | OPENCL_V(clEnqueueWriteBuffer( *commQueueFFT, |
| 4600 | /*fftPlan->*/const_buffer, |
| 4601 | 1, // TODO? non-blocking write? |
| 4602 | 0, |
| 4603 | sizeof(ConstantBufferParams), |
| 4604 | &ConstantBufferParams, |
| 4605 | 0, |
| 4606 | NULL, |
| 4607 | NULL), _T("clEnqueueWriteBuffer failed") ); |
| 4608 | |
| 4609 | return CLFFT_SUCCESS; |
| 4610 | } |
| 4611 | |
| 4612 | |
| 4613 | clfftStatus clfftDestroyPlan( clfftPlanHandle* plHandle ) |