code: def sum_after_2_to_4(matrix):
      cur_sum = 0.0
      use_cuda = use_gpu()
      if not use_cuda:
          for row in range(matrix.shape[0]):
              for col in range(0, matrix.shape[1], 4):
                  ix = np.argsort(np.abs(matrix[row, col : col + 4]))
                  cur_sum += abs(matrix[row, col + ix[2]])
                  cur_sum += abs(matrix[row, col + ix[3]])
      else:
          matrix = matrix.astype(np.float32)
          cuda_sum = np.zeros((1), dtype=np.float32)
          matrix_view = np.copy(matrix).flatten()
          sum_view = cuda_sum.flatten()
          blocks = max(int(matrix.shape[1] / 4 / 2), 1)
          threads = min(max(math.ceil(matrix.shape[0] / 4), 1), 1024)
          result = permutation_search_cuda_kernels.sum_after_2_to_4(
              matrix_view,
              matrix.shape[0],
              matrix.shape[1],
              0,
              matrix.shape[1],
              blocks,
              threads,
              sum_view,
          )
          cur_sum = sum_view[0]
      return cur_sum
  
imports: import numpy
  import time
  import subprocess
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: sum_after_2_to_4(matrix) and returns: cur_sum