Chapter 12 Filter
Chapter 12 Filter
CHAPTER
Filter And warp voting
CONTENTS 12.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 12.2 A simple parallel unstable filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 12.3 Coalescing atomic operations with warp-level primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 12.4 Privatization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 12.5 A simple parallel stable filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 12.6 Improving memory coalescing with shared memory and thread coarsening . . . . . . 298 12.7 In-place stable filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 12.8 Related patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 12.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 12.10 Exercises. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 Filter operations rearrange data in a list to make more efficient use of memory after some of the list elements are deleted. If we view the deleted elements and the remaining elements as two sub-lists, a filter operation can be viewed as the inverse of a merge operation. In this chapter, we show that using a technique called warp voting we can enable coalescing of atomic operations across threads and improve the speed of parallel implementations of filter. We look at the considerations for performing the stable filter operation in place instead of out of place. Finally, we discuss other related patterns with similar implementations and optimizations, such as removing duplicates from a sorted list and adding/removing rows and columns from a matrix.
Filter operations rearrange data in a list to make more efficient use of memory after some of the list elements are deleted. If we view the deleted elements and the remaining elements as two sub-lists, a filter operation can be viewed as the inverse of a merge operation. In this chapter, we show that using a technique called warp voting we can enable coalescing of atomic operations across threads and improve the speed of parallel implementations of filter. We look at the considerations for performing the stable filter operation in place instead of out of place. Finally, we discuss other related patterns with similar implementations and optimizations, such as removing duplicates from a sorted list and adding/removing rows and columns from a matrix.
12.1 Background
Filtering refers to a computation that removes one or more selected items from a list according to a given criterion and compacts the list to eliminate the holes thus created. An example use case is garbage collection. After the application de-allocates some objects and frees their chunks of memory from the heap, there can be many small chunks of available memory. At some point, it may be desirable to compact the remaining objects on the heap into consecutive locations and create a much larger chunk of available memory space at the end of the heap. In this way, if the application needs to allocate a large object, there is sufficient consecutive memory available. Programming Massively Parallel Processors. https://doi.org/10.1016/B978-0-44-343900-1.00022-6 Copyright © 2027 Elsevier Inc. All rights are reserved, including those for text and data mining, AI training, and similar technologies.
FIGURE 12.1. Unstable vs. stable variants of the out-of-place filter pattern.
When the list is very large, it becomes desirable to employ many threads to move the items in parallel to reduce execution time. Filters can be in-place or out-of-place. In-place filters compact the remaining items in the original list, whereas out-of-place filters compact them into a new list. In the memory management example, creating a new list means that enough memory must be set aside to accommodate the entire new heap, drastically increasing the inefficiency of memory usage. However, moving an item to an earlier position in the list may overwrite the element that is currently in that position waiting to be moved to an earlier position. Thus, when multiple threads are employed to move the items in a list, the threads must synchronize so that no items would be incorrectly overwritten before they can be moved. In this chapter, we will first learn to implement out-of-place filters that are often used in data search/retrieval applications to generate a relevant list by removing irrelevant items. The general approach to parallelizing out-of-place filters is to have multiple threads to simultaneously move the remaining items into the new list. We then introduce in-place filter implementation techniques that can be built on top of the scan pattern introduced in Chapter 11. Fig. 12.1 shows examples of the two variants of the filter operation. Following the convention in computer science, we will refer to the items in a filtered list as keys. The shaded keys in the input list indicate the keys that remain where as unshaded keys are deleted. Stable filters preserve the original order of the remaining keys, whereas unstable filters do not. Unstable filters are used when the list does not need to be ordered. We will begin with parallel implementation of unstable filters.
12.2 A simple parallel unstable filter
Fig. 12.2 shows the code for a simple unstable filter kernel. The kernel takes an input array of size N and filters it into an output array. The parameter outputSize points to a FIGURE 12.2 Code for a simple unstable filter kernel.
12.3 Coalescing atomic operations with warp-level primitives
global memory counter variable where the size of the output array is to be stored and is initialized to zero before the kernel is called. Every thread identifies the index of the key in the input that it is responsible for (line 03), checks if that index is within bounds (line 04), and loads the key at that index from global memory (line 05). The thread then checks if the loaded value meets the condition cond() by which we are filtering (line 06). If the condition is met, the thread allocates space for that value in the output array by atomically incrementing the counter at outputSize (line 07-09). Finally, the thread stores the value to the allocated space (line 10). Note that this implementation results in an unstable filter operation because the atomic operations on the counter may be performed by the hardware in any order. Hence, each thread will acquire an arbitrary place in the output array to put its value in irrespective of the input key’s position in the input array. A clear bottleneck in this implementation is the contention caused by the atomic operations on the output counter in global memory. This contention is exacerbated by the fact that all the atomic operations are performed on the same counter, so they are all serialized by the hardware. As we learned in Chapter 9, output contention can be mitigated via the privatization optimization which we look at in Section 12.4. However, before looking at privatization, we will first look at another technique for reducing contention, called coalesced atomic operations, that leverages the fact that the atomic operations are performed on the same counter by threads of the same warp.
In the simple unstable filter kernel in Fig. 12.2, atomic operations contend on the same output counter causing a performance bottleneck. This contention is particularly pronounced for threads in the same warp that issue their atomic operations at the same time. In this case, the atomic operations are certain to conflict with each other and get serialized by the hardware. However, we can take advantage of the fact that threads in the same warp can coordinate quickly with each other to avoid this situation. Rather FIGURE 12.3 Code for unstable filter kernel with coalesced atomic operations.
than having each thread in the warp independently issue an atomic operation, we can have the threads coordinate to identify the total amount by which they would like to collectively increment the counter, then have one thread in the warp issue a single atomic operation on behalf of the rest. We will refer to the combined atomic operation as a coalesced atomic operation. It is similar to how loads and stores by threads in the same warp are coalesced by the hardware (Chapter 5). The detailed steps for coalescing the atomic operations are as follows. First, we assign a leader thread from among the threads in the warp that are active when the atomic operation is performed. Second, we identify the total amount that needs to be added by all the threads. Third, we have the leader thread perform the atomic operation on the global counter and broadcast the beginning of the acquired space to the other threads. Fourth, each thread identifies its offset within the acquired space where it will store its output key. These steps require the use of special warp-level primitives, including shuffle instructions which were introduced in Chapter 10 as well as other primitives which are introduced in this section. Fig. 12.3 shows the code for implementing an unstable filter kernel that uses coalesced atomic operations. Compared to the simple implementation in Fig. 12.2, the difference starts on line 07 where the atomic operation is performed. In Fig. 12.3, we start by identifying which threads are active by calling the __activemask() primitive (line 07). This primitive returns a 32-bit integer where bit i is set to 1 if the i th thread in the warp is active. For example, if the threads that are active inside the if-statement are threads 1, 2, 4, and 5, then __activemask() will return 00000000000000000000000000110110.
Once we know which threads are active, we need to assign a leader thread from among the active threads. A deterministic way of doing so is by picking the active thread with the smallest index within the warp as the leader. In other words, we need to find the index of the least significant bit that is set to 1 in the active mask. To do so, we call the __ffs() (Find First Set) intrinsic on the active mask (line 10) which finds the least significant bit that is set to 1 in the mask. We subtract one from the value returned by __ffs() because the intrinsic adds a one to the index it returns because the return value of zero is reserved for when none of the bits in the mask are set. Once we have identified a leader thread, the leader thread needs to find out by how much the threads in the warp collectively want to increment the counter. Since in the original code, each active thread incremented the counter by one, that means that the total amount to increment the counter is equal to the total number of active threads in the warp. This number can be obtained by counting the number of bits that are set to one in the active mask, which is done by calling the __popc() (Population Count) intrinsic on the mask (line 13). Once the leader thread knows the total amount to increment the counter by, it proceeds to increment the global counter by this total amount (lines 15-17). The returned value, which is saved in j, marks the beginning index into the output array where the active threads in the warp will place their values. This value is shuffled from the leader thread to all the other active threads in the warp (line 20). Once each active thread knows the warp’s beginning index into the output array, what remains is for each active thread to find its offset from this index. That is, the first active thread will have an offset of 0, the second active thread will have an offset of 1, etc. In other words, a thread’s offset is equivalent to the number of active threads that precede it in the warp. Finding this value is equivalent to performing a binary prefix sum operation [1] on the active mask. To find the value, each thread starts by generating a mask that represents the preceding threads in the warp. That is, thread i in the warp generates a mask where bits 0 to i − 1 are set. This mask can be generated by computing 2i − 1 (line 22). After that, the mask of preceding threads is intersected with the mask of active threads to obtain the active preceding threads (line 23). Finally, calling __popc() on the mask of active preceding threads will return the number of active preceding threads (line 24), which is the offset we’re looking for. Once the offset is known, the active threads store their filtered values at the starting index plus the thread’s offset (line 26). Here, we observe another benefit of using coalesced atomic operations in this context. In addition the reducing the number of atomic operations, using coalesced atomic operations also results in active threads in the warp storing their filtered values at adjacent memory locations. Hence, the stores to global memory are more likely to be coalesced by the hardware. To coalesce the atomic operations, we have had to perform many operations that involve managing the active threads in a warp. To facilitate the management of active warp threads, the cooperative groups API provides a special kind of group called a coalesced group. A coalesced group is a cooperative group that represents the active threads in a warp. Programmers can get a handle on a coalesced group as follows:
FIGURE 12.4. Code for unstable filter kernel with coalesced atomic operations using cooperative groups.
coalesced_group activeThreads = coalesced_threads();
Using this handle, it becomes easy to find the number of active threads in the warp and the index of an active thread with respect to other active threads. The number of active threads in the warp is simply the size of the group, i.e., activeThreads.size(). The index of an active thread with respect to other active threads is simply the thread’s rank in the group, i.e., activeThreads.thread_rank(). Fig. 12.4 shows how the code in Fig. 12.3 can be simplified using the cooperative groups API. Instead of using the __activemask() intrinsic function to find the active threads in the warp (line 07 in Fig. 12.3), we declare and initialize a cooperative group (line 07 in Fig. 12.4). Instead of using the __ffs() intrinsic function to assign a leader thread (lines 10-11 in Fig. 12.3), we designate the thread whose rank is zero as the leader (line 10 in Fig. 12.4). Instead of using the __popc() intrinsic function to find the number of active threads (line 13 in Fig. 12.3), we get the size of the coalesced group (line 12 in Fig. 12.4). The shuffle instruction is also performed using the coalesced group (line 19 in Fig. 12.4). Finally, instead of using bitwise calculations to find the thread’s index with respect to other threads in the warp (lines 22-24 in Fig. 12.3), we get the thread’s rank in the group (line 21 in Fig. 12.4). In practice, the compiler already implements the optimization of coalescing atomic operations that we discussed in this section, so it is unnecessary for programmers to apply it manually. Moreover, it is unnecessary to apply the optimization if there is only one thread in the warp that executes the atomic operation, and the compiler indeed refrains from applying the optimization if it can establish that only one thread in the warp is active. Despite programmers not needing to apply this optimization in practice, it is still a good exercise to see how such an optimization would FIGURE 12.5 Unstable filter with privatization.
12.4 Privatization
be implemented because it is a good opportunity to introduce warp voting functions (namely __activemask()), intrinsic functions such as __ffs() and __popc(), and coalesced groups from the cooperative groups API. Other warp voting functions that programmers might encounter include __all_sync() which checks if all threads in the warp evaluate some condition as true, __any_sync() which checks if some thread in the warp evaluates some condition as true, and __ballot_sync which returns a mask of which threads evaluate some condition as true.
We have seen in Section 12.3 how coalesced atomic operations can reduce the contention of the atomic operations on the output list counter. In this section, we look at another optimization for reducing the contention on the counter, namely privatization. Recall from Chapter 6 and Chapter 9 that privatization is an optimization where private versions of the output data are created and updated to reduce contention on the public output data, and then the private versions are merged with the public version at the end. We apply this same optimization to the filter pattern. Fig. 12.5 illustrates how privatization can be applied in the context of the filter pattern. We create private versions of the output array and the output counter for each thread block in the shared memory. While processing the input keys, threads atomically update their thread block’s private counter and place their filtered keys in their thread block’s private output array. When all the input keys have been processed, one thread in the thread block atomically updates the public output counter and the threads collaboratively write the contents of the block’s private output array to the public output array. The private counters and private output arrays are placed in shared memory to reduce latency and increase throughput for atomically updating the counter and writing to the output private array. Fig. 12.6 shows the code for implementing an unstable filter kernel with privatization applied. We start by declaring a private output list (line 05) and private counter FIGURE 12.6 Code for unstable filter kernel with privatization.
(line 06) for each thread block in shared memory. Next, one of the threads in the block initializes the private counter to zero (lines 07-09). The threads then execute a barrier synchronization to ensure that the counter is initialized before any of the threads start updating it (line 10). The threads then proceed to perform the filter operation, but place the filtered values in the private output list instead of the public output list (lines 13-22). This code is similar to the code in Fig. 12.2, except that the private counter and private output list are used instead of the public ones. Also, the scope of the atomic reference to the counter is cuda::thread_scope_block instead of cuda::thread_scope_device since the counter in shared memory is only accessed by threads in the same block. Another barrier synchronization is then executed to ensure that all threads finish adding to the private output list before it is committed to the public output list (line 23). The next step is to reserve space for the private output list in the public output list. Here, one thread in the block atomically updates the public counter, incrementing it by the total number of keys in the private output list (lines 26-31). The beginning index of the reserved space, j, is placed in shared memory so that it can be accessed by the other threads in the block. A barrier synchronization ensures that j is written to shared memory before any of the other threads start using it (line 32). The final step is to write the private output list to the public output list. Consecutive threads will write consecutive keys, hence we use the thread index to read from the private output list and write to the public output list starting at j (lines 35-37). Similar to the case of coalesced atomic operation, we observe the additional benefit of privatization besides reduced contention on the public counter. Since consecutive threads write consecutive keys to global memory, the memory stores will be coalesced.
12.5 A simple parallel stable filter
We now turn our attention to parallelizing the stable filter operation, where the filtered keys retain the same order in the output list that they had in the input list. The need to retain the order of the keys means that a thread cannot place a filtered key in an arbitrary place in the output list by atomically incrementing a counter. Instead, the thread needs to find out the specific place where the key should go in the output list by finding out how many of the preceding input keys were filtered. Stable filters are used when some select elements are to be deleted or extracted from a sorted list. Fig. 12.7 illustrates how the stable filter operation can be parallelized. A thread is launched for each key in the input list. Each thread evaluates the condition on its input value and sets a ``keep’’ flag that indicates whether the input value should be kept or not. Next, the thread must identify the offset of its key in the output list by identifying how many preceding keys will be placed in the output list. In other words, FIGURE 12.7 Parallelizing the stable filter operation.
FIGURE 12.8. Code for a simple stable filter kernel.
the thread needs to find the sum of the ``keep’’ values of all the preceding threads. Finding this sum for all preceding threads amounts to an exclusive scan operation, which we have studied in Chapter 11. We can also optimize this prefix sum operation by leveraging the fact that its input is binary and performing a binary prefix sum [1] on small segments using bit-level operations, as shown in Section 12.3. Once the thread identifies its key’s offset in the output list, it proceeds to store the key in the output list. Fig. 12.8 shows the code for a simple stable filter kernel. First, each thread identifies the index of the key that it is responsible for (line 03) and loads it from global memory (line 04). Next, the thread evaluates the filter condition on the value and sets the integer keep to 1 if the condition is true, and 0 otherwise (line 05). After that, the threads in the grid execute a grid-wide exclusive scan on the keep value to obtain the offset of the key in the output list (line 06). This grid-wide exclusive scan is performed within a single kernel following the single-kernel scan implementation discussed in Chapter 11. The threads with a key to be kept write their key to the output list at the offset obtained from the scan operation (lines 07-09). Finally, the last thread in the grid writes out the total size of the resulting output list (lines 10-12).
12.6 Improving memory coalescing with shared memory and thread coarsening
One source of inefficiency in the simple stable filter implementation presented in Section 12.5 is that not all threads in the block participate when storing the filtered keys to global memory. This situation misses opportunities for memory coalescing because keys being written to adjacent memory locations in global memory may be written by threads in different warps with many inactive threads between them. These missed opportunities can be recovered by gathering the filtered keys in shared memory, and then writing them from shared memory to global memory as one contiguous chunk. Fig. 12.9 illustrates how this form of privatization can be applied. In this case, 12.6 Improving memory coalescing FIGURE 12.9 Using shared memory to improve memory coalescing.
FIGURE 12.10. Thread coarsening to further improve memory coalescing. This toy example assumes that two thread blocks are used and each thread block consists of four threads.
adjacent output keys are written from shared memory to global memory by consecutive threads, increasing the number of adjacent keys written by the same warp, and hence the opportunities for memory coalescing. To further improve memory coalescing, thread coarsening can also be applied. Fig. 12.10 illustrates how thread coarsening can be applied in the context of stable filter. Each thread block is assigned more keys to filter than the number of threads in the block, which results in fewer and larger contiguous chunks of output keys being written from shared memory to global memory. Having fewer and larger chunks exposes more opportunities for memory coalescing which further improves performance. Here, the price of finer-grain parallelization can be thought of as the need to divide the output lists into smaller chunks which impacts memory coalescing. Perhaps an even more important benefit of thread coarsening is its impact on the scan operation. The scan operation is the most expensive part of the stable filterprocess. Recall from Chapter 11 that scan benefits substantially from thread coarsening because it improves work efficiency and reduces synchronization overhead. By coarsening the filter operation, we naturally coarsen the scan operation within it, which substantially improves the performance of stable filter as a whole. We leave the detailed stable filter implementation with exclusive scan, privatization, and thread coarsening as an exercise.
12.7 In-place stable filter
In many situations, we may want to perform a filter operation in place. In other words, we may want for the output of the filter operation to occupy the same memory array as the input, not a separate array. One situation we may prefer an in-place operation is where the array being filtered is very large relative to the capacity of the GPU’s global memory. For example, in our heap object de-allocation example (Section 12.1), there may not be enough space in the global memory to accommodate a new filtered heap. In this case, we may not want to allocate a separate array for storing the output keys. When performing a filter operation in place, we must be careful not to write any output keys to the array before reading the keys that used to occupy the same memory location. For example, in Fig. 12.10, if the filter operation was done in place, where the input and output arrays are the same, then k3 would occupy the same location that k1 used to occupy. For this reason, we must ensure that thread 1 finishes reading k0 before thread 3 writes k3 . This ordering can easily be enforced by making sure that the thread block executes a barrier synchronization between the step where all the threads read the input values and the step where they write the output values. A less trivial scenario arises where the threads that read and write in the same location are in different thread blocks. For example, in Fig. 12.10, if the filter operation was done in place, then k8 would occupy the same location 4 that k4 used to occupy. However, the threads that read and write these keys are in different thread blocks. Hence, we must ensure that the second block does not write any values before the first block reads its values. In general, we must ensure that no block writes any values before all preceding blocks read their values. It turns out that this ordering is already enforced by the device-wide scan operation. Hence, the code that we have written also works if an in-place filter operation is desired. To demonstrate that the desired ordering for in-place filter is already enforced, Fig. 12.11 illustrates the dependence between different operations in the stable filter implementation. The desired ordering is that for any pair of blocks i and j such that j > i, the read of i happens before the write of j . We can see from the diagram that this is true. The read of i happens before the scan of i, which happens before the scan of j since j > i, which happens before the write of j . We leave it as an exercise for the reader to adapt a single-kernel implementation of exclusive scan into a single kernel implementation of in-place stable filter.
12.8 Related patterns
FIGURE 12.11. Dependence diagram for stable filter.
The stable filter operation is one example of a more general class of patterns where data needs to be moved in a one-directional manner. We review some of these patterns in the section, while noting that many of the optimizations discussed in the context of stable filter are applicable to these related patterns as well. One similar pattern to stable filter is removing duplicate keys from a sorted list. This pattern can be viewed as a special case of the filter pattern where the condition for the key to be preserved is that the key is not equal to the preceding key. Another similar pattern is removing rows and/or columns from a matrix. This pattern resembles filtering in that specific keys need to be removed from the input array, however, the difference is that the keys are removed based on their index, not based on their values. Consequently, threads can analytically determine their keys’ positions in the output without the need to perform a scan operation. However, if the operation were to be performed in place, we would still need to make sure that earlier thread blocks read their input values before later thread blocks write their output values. In this case, we can use the one-directional synchronization used in the single-pass scan operation just for enforcing an ordering between thread blocks, but without the need to propagate a partial sum. One more similar pattern is adding rows and/or columns to a matrix. Such pattern often occurs when adjusting the matrix layout to improve memory alignment. Like removing rows/columns, this pattern also determines where keys are to be moved analytically without the need to perform a scan operation. However, one notable difference is that the keys are moved outward in the array, not inward. If the operation were out-of-place, this difference is not significant. However, if the operation were in-place, then this difference affects the direction of synchronization. Since keys are moving outwards, it is now the earlier thread blocks that write to memory locations previously occupied by keys read by earlier thread blocks. Hence, we need to ensure that later thread blocks finish reading their input values before earlier thread blocks write their output values. In this case, the one-directional synchronization is performed in the opposite direction, from the thread block processing the last set of keys to the thread block processing the first set of keys. Interested readers are referred to the literature for more complex data in-place data movement patterns such as transposition of matrices and tensors [2].
12.9 Summary
In this chapter, we discussed the parallel implementations and optimizations of both stable and unstable filters. The unstable out-of-place filters are based on atomic operations and the optimizations are focused on minimizing the number of atomic operations on the counter and the coalescing of writes to the output. The stable outof-place filters are based on the scan operation and can be built on the single-pass scan kernel in Chapter 11. In practice, the Thrust [3] and CUB [4] libraries offer filter implementations. Once the reader has mastered the introduction and optimizations of different types of filters, the reader is well equipped to select the Thrust or CUB API functions that are appropriate for the application.
12.10 Exercises
\1. Implement a stable filter with exclusive scan as three separate kernels: condition evaluation, exclusive scan, and output generation. 2. Implement stable filter as a single kernel by adding the filtering code into a one-pass scan kernel. What are the major advantages of a single-kernel implementation? 3. Apply privatization to the kernel in Exercise 2. 4. Apply thread coarsening to the kernel in Exercise 3.
References [1] M. Harris, M. Garland, Optimizing parallel prefix operations for the Fermi architecture, in: GPU Computing Gems Jade Edition, Elsevier, 2012, pp. 29–38. [2] I.-J. Sung, J. Gómez-Luna, J.M. González-Linares, N. Guil, W.-M.W. Hwu, In-place transposition of rectangular matrices on accelerators, ACM SIGPLAN Notices 49 (8) (2014) 207–218. [3] N. Bell, J. Hoberock, Thrust: a productivity-oriented library for cuda, in: GPU Computing Gems Jade Edition, Elsevier, 2012, pp. 359–371. [4] NVIDIA, CUB, https://nvidia.github.io/cccl/cub/index.html, 2025.
CHAPTER
Merge And dynamic input data identification With special contributions from Li-Wen Chang and Jie Lv
References
[1] M. Harris, M. Garland, Optimizing parallel prefix operations for the Fermi architecture, in: GPU Computing Gems Jade Edition, Elsevier, 2012, pp. 29–38.
[2] I.-J. Sung, J. Gómez-Luna, J.M. González-Linares, N. Guil, W.-M.W. Hwu, In-place transposition of rectangular matrices on accelerators, ACM SIGPLAN Notices 49 (8) (2014)
[3] N. Bell, J. Hoberock, Thrust: a productivity-oriented library for cuda, in: GPU Computing Gems Jade Edition, Elsevier, 2012, pp. 359–371.
[4] NVIDIA, CUB, https://nvidia.github.io/cccl/cub/index.html, 2025.