Mercurial > hg > GearsTemplate
changeset 432:6bb391fc9e12
Work CudaExec
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 17 Oct 2017 02:09:14 +0900 |
parents | b3359544adbb |
children | d920f3a3f037 |
files | src/parallel_execution/examples/bitonicSort/CUDAbitonicSwap.cu src/parallel_execution/examples/bitonicSort/bitonicSwap.cbc |
diffstat | 2 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/examples/bitonicSort/CUDAbitonicSwap.cu Tue Oct 17 01:50:12 2017 +0900 +++ b/src/parallel_execution/examples/bitonicSort/CUDAbitonicSwap.cu Tue Oct 17 02:09:14 2017 +0900 @@ -2,10 +2,17 @@ struct Integer { int value; }; - __global__ void bitonicSwap(struct Integer* array, int* blockPtr, int* firstPtr, int* prefixPtr) { - int block = *blockPtr; - int first = *firstPtr; - int prefix = *prefixPtr; + struct SortArray { + struct Integer *array; + int loopCounter; + int block; + int first; + int prefix; + }; + __global__ void bitonicSwap(struct Integer* array, struct SortArray* sortArray) { + int block = sortArray->block; + int first = sortArray->first; + int prefix = sortArray->prefix; int i = 0; C_bitonicSwap: if (i < prefix) {
--- a/src/parallel_execution/examples/bitonicSort/bitonicSwap.cbc Tue Oct 17 01:50:12 2017 +0900 +++ b/src/parallel_execution/examples/bitonicSort/bitonicSwap.cbc Tue Oct 17 02:09:14 2017 +0900 @@ -35,7 +35,9 @@ struct SortArray* inputSortArray = &context->data[context->idg]->SortArray; struct SortArray* outputSortArray = &context->data[context->odg]->SortArray; struct CudaBuffer* buffer = &ALLOCATE(context, CudaBuffer)->CudaBuffer; - buffer->inputData = (union Data**){inputSortArray->array, inputSortArray}; + buffer->inputData = (union Data**)ALLOCATE_PTR_ARRAY(context, SortArray, 2); + buffer->inputData[0] = (union Data*)inputSortArray->array; + buffer->inputData[1] = (union Data*)inputSortArray; buffer->outputData = NULL; buffer->inputLen = 2; buffer->outputLen = 0;