Exemplo n.º 1
0
import ThrustRTC as trtc

darr = trtc.device_vector_from_list([1, 0, 2, 2, 1, 3], 'int32_t')
print(trtc.Min_Element(darr))
print(trtc.Max_Element(darr))
print(trtc.MinMax_Element(darr))
Exemplo n.º 2
0
 def amin(row, idx, length):
     perm_in = trtc.DVPermutation(row, idx)
     index = trtc.Min_Element(perm_in.range(0, length))
     row_idx = idx.get(index)
     result = row.get(row_idx)
     return result
Exemplo n.º 3
0
 def amin(row, idx):
     perm_in = trtc.DVPermutation(row.data, idx.data)
     index = trtc.Min_Element(perm_in.range(0, len(row)))
     row_idx = idx[index]
     result = row[row_idx]
     return result