Delete rows and columns in matrix

In my program, it is needed to delete the corresponding rows and columns indexed by an array. I am wondering how to efficiently implement this in CUDA? Thanks.

In my program, it is needed to delete the corresponding rows and columns indexed by an array. I am wondering how to efficiently implement this in CUDA? Thanks.

There probably isn’t a way to do it directly. What you could do is use a mask array, so that when you delete, you just set the appropriate mask entry and have subsequent code skip the masked entries. If you want to physically remove the masked entries from the matrix, then you could pass the mask to a stream compaction routine. Thrust, cudpp and chag::pp all have efficient stream compact routines you could probably adapt for this.

There probably isn’t a way to do it directly. What you could do is use a mask array, so that when you delete, you just set the appropriate mask entry and have subsequent code skip the masked entries. If you want to physically remove the masked entries from the matrix, then you could pass the mask to a stream compaction routine. Thrust, cudpp and chag::pp all have efficient stream compact routines you could probably adapt for this.