Skip to content
Jacob See edited this page Mar 18, 2015 · 1 revision

Function Overview


CreateSquareMatrix

Creates a square matrix object of single-precision floating-point values.

Definition

Matrix CreateSquareMatrix(int side_length, int type);

Arguments

  1. side_length - An integer representing the length of a single side of a square matrix.
  2. type - Initialization type. Either INIT_ZEROES or INIT_RANDOM.

PrintMatrix

Prints the contents of a square matrix object to the console's standard output.

Definition

void PrintMatrix(Matrix m, int side_length);

Arguments

  1. m - The matrix object to be printed.
  2. side_length - The length of one side of the input matrix.

CLSquareMatrixMultiply

Multiplies two input matrices using OpenCL, either on the CPU or on an available GPU.

Definition

void CLSquareMatrixMultiply(Matrix src_a_matrix, Matrix src_b_matrix, Matrix &dest_h, int side_length, int device_type);

Arguments

  1. src_a_matrix - First matrix object to be multiplied.
  2. src_b_matrix - Second matrix object to be multiplied.
  3. dest_h - The matrix object to be populated with the multiplication result.
  4. side_length - The length of one side of one of the square input matrices.
  5. device_type - The target device to perform the multiplication. Either DEVICE_TYPE_CPU or DEVICE_TYPE_GPU.

Free

Frees the memory occupied by a matrix object.

Definition

void Free(Matrix m, int size);

Arguments

  1. m - The matrix object to be freed.
  2. size - The length of one side of the square matrix object to be freed.