Vector functions

C/C++

void sdp_vector_add(const sdp_Mem *input_a, const sdp_Mem *input_b, sdp_Mem *output, sdp_Error *status)

Simple example to add two vectors, element-wise.

Parameters:
  • input_a – First input vector.

  • input_b – Second input vector.

  • output – Output vector.

  • status – Error status.

Python

ska_sdp_func.examples.vector_add(input_a, input_b, output)

Simple example to add two vectors, element_wise.

Parameters can be either numpy or cupy arrays, but must all be consistent, and with the same length and data type. Computation is performed either on the CPU or GPU as appropriate.

Parameters:
  • input_a (numpy.ndarray or cupy.ndarray) – First input vector.

  • input_b (numpy.ndarray or cupy.ndarray) – Second input vector.

  • output (numpy.ndarray or cupy.ndarray) – Output vector.