1

Is there an alternative of std::memcmp in cuda? I want to compare the whole rows in a matrix, on cpu, simply call std::memcmp is ok, is there a high efficient way to do this on gpu?

The operation is like this: Sorting arrays in NumPy by column

hgt312
  • 11
  • 4

1 Answers1

0

While not functionally identical to std::memcmp, the thrust template library includes a comparison reduction operation thrust::equal which will return true or false when the elements of two iterator ranges compare identically.

If you actually require the sign of the comparison, you would need to write your own implementation.

talonmies
  • 70,661
  • 34
  • 192
  • 269