5 #include <AdlPrimitives/Sort/RadixSortSimple.inl>
6 #include <AdlPrimitives/Sort/RadixSortStandard.inl>
7 #include <AdlPrimitives/Sort/RadixSortAdvanced.inl>
10 #define DISPATCH_IMPL(x) \
11 switch( data->m_option ) \
13 case SORT_SIMPLE: RadixSortSimple<TYPE>::x; break; \
14 case SORT_STANDARD: RadixSortStandard<TYPE>::x; break; \
15 case SORT_ADVANCED: RadixSortAdvanced<TYPE>::x; break; \
16 default:ADLASSERT(0);break; \
19 template<DeviceType TYPE>
20 typename RadixSort<TYPE>::Data* RadixSort<TYPE>::allocate(const Device* deviceData, int maxSize, Option option)
22 ADLASSERT( TYPE == deviceData->m_type );
28 dataOut = RadixSortSimple<TYPE>::allocate( deviceData, maxSize, option );
31 dataOut = RadixSortStandard<TYPE>::allocate( deviceData, maxSize, option );
34 dataOut = RadixSortAdvanced<TYPE>::allocate( deviceData, maxSize, option );
40 return (typename RadixSort<TYPE>::Data*)dataOut;
43 template<DeviceType TYPE>
44 void RadixSort<TYPE>::deallocate(Data* data)
46 DISPATCH_IMPL( deallocate( data ) );
49 template<DeviceType TYPE>
50 void RadixSort<TYPE>::execute(Data* data, Buffer<SortData>& inout, int n, int sortBits)
52 DISPATCH_IMPL( execute( data, inout, n, sortBits ) );