code: def try_permutations_on_matrix(matrix, permutations):
      use_cuda = use_gpu()
      assert use_cuda  # caller should have checked
      matrix = np.copy(matrix)
      matrix = matrix.astype(np.float32)
      matrix_view = np.copy(matrix).flatten()
      permutations_view = (
          np.copy(np.asarray(permutations)).astype(np.uint32).flatten()
      )
  
      stripe_groups = np.asarray(
          [[s for s in range(int(matrix.shape[1] / 4))]]
      ).astype(np.uint32)
      stripe_groups_view = stripe_groups.flatten()
  
      improvement = np.zeros((1), dtype=np.float32).flatten()
      permutation = np.zeros((1), dtype=np.uint32).flatten()
  
      result = permutation_search_cuda_kernels.check_permutations(
          matrix_view,
          matrix.shape[0],
          matrix.shape[1],
          stripe_groups_view,
          len(stripe_groups[0]),
          len(stripe_groups),
          permutations_view,
          len(permutations),
          improvement,
          permutation,
      )
      return improvement[0], permutations[permutation[0]]
  
imports: import numpy
  import time
  import subprocess
  import math
label_desc: Use image node_id 8 for calling a global function with example usage: try_permutations_on_matrix(matrix, permutations) and returns: improvement,  permutations