13.07.2015 Views

Using Thrust to Sort CUDA FORTRAN Arrays - NVIDIA Developer ...

Using Thrust to Sort CUDA FORTRAN Arrays - NVIDIA Developer ...

Using Thrust to Sort CUDA FORTRAN Arrays - NVIDIA Developer ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Thrust</strong> Wrapper Functions <strong>Sort</strong> Implementation PerspectivesAdd <strong>FORTRAN</strong> interface for Wrappersmodule thrustinterface thrustsortthrust_module.cufMakefileNVINC = -I/usr/local/cuda/includeF90FLAGS = -rc=rc4.o -Mcuda=cc20 -O3subroutine sort_int(input,N) bind(C,name="sort_int_wrapper")use iso_c_bindinginteger(c_int),device:: input(*)integer(c_int),value:: Nend subroutinesubroutine sort_float(input,N) bind(C,name="sort_float_wrapper")use iso_c_bindingreal(c_float),device:: input(*)integer(c_int),value:: Nend subroutineall: csort.o thrust_module.ocsort.o: csort.cunvcc -c -arch sm_13 $(NVINC) $^ -o $@thrust_module.o: thrust_module.cufpgf90 –c $(F90FLAGS) $^ -o $@clean:rm csort.osubroutine sort_double(input,N) bind(C,name="sort_double_wrapper")use iso_c_bindingreal(c_double),device:: input(*)integer(c_int),value:: Nend subroutineend interfaceend module thrust© 2011 <strong>NVIDIA</strong> Corporation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!