multi item replacing in cuda thrust
问题 I have a device vector A,B,C as following. A = [1,1,3,3,3,4,4,5,5] B = [1,3,5] C = [2,8,6] So I want to replace each of B in a with corresponding element in C. Eg: 1 is replaced by 2, 3 is replaced by 8, 5 is replaced by 6 so as to get the following result Result = [2,2,8,8,8,4,4,6,6] How do I achieve this in cuda thrust or any way of implementing it in cuda C++. I found thrust::replace which replaces single element at once. Since I need to replace huge amount of data, it becomes bottleneck