From 13eaf6e1e8018e0cda03d60d9a46094f7f231d2b Mon Sep 17 00:00:00 2001 From: jeremiah-corrado <62707311+jeremiah-corrado@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:14:02 -0600 Subject: [PATCH] update Commands.chpl to reflect recent changes to the linear algebra module s.t. servers can build in the default config without chapel-py (#3724) Signed-off-by: Jeremiah Corrado --- src/registry/Commands.chpl | 129 ++++++++++++++++++++----------------- 1 file changed, 69 insertions(+), 60 deletions(-) diff --git a/src/registry/Commands.chpl b/src/registry/Commands.chpl index 14aea507b3..70c5f95ac0 100644 --- a/src/registry/Commands.chpl +++ b/src/registry/Commands.chpl @@ -869,6 +869,39 @@ registerFunction('takeAlongAxis', ark_takeAlongAxis_bigint_bigi import LinalgMsg; +proc ark_reg_transpose_generic(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab, type array_dtype_0, param array_nd_0: int): MsgTuple throws { + var array_array_sym = st[msgArgs['array']]: SymEntry(array_dtype_0, array_nd_0); + ref array = array_array_sym.a; + var ark_result = LinalgMsg.transpose(array); + var ark_result_symbol = new shared SymEntry(ark_result); + + return st.insert(ark_result_symbol); +} + +proc ark_transpose_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do + return ark_reg_transpose_generic(cmd, msgArgs, st, array_dtype_0=int, array_nd_0=1); +registerFunction('transpose', ark_transpose_int_1, 'LinalgMsg', 289); + +proc ark_transpose_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do + return ark_reg_transpose_generic(cmd, msgArgs, st, array_dtype_0=uint, array_nd_0=1); +registerFunction('transpose', ark_transpose_uint_1, 'LinalgMsg', 289); + +proc ark_transpose_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do + return ark_reg_transpose_generic(cmd, msgArgs, st, array_dtype_0=uint(8), array_nd_0=1); +registerFunction('transpose', ark_transpose_uint8_1, 'LinalgMsg', 289); + +proc ark_transpose_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do + return ark_reg_transpose_generic(cmd, msgArgs, st, array_dtype_0=real, array_nd_0=1); +registerFunction('transpose', ark_transpose_real_1, 'LinalgMsg', 289); + +proc ark_transpose_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do + return ark_reg_transpose_generic(cmd, msgArgs, st, array_dtype_0=bool, array_nd_0=1); +registerFunction('transpose', ark_transpose_bool_1, 'LinalgMsg', 289); + +proc ark_transpose_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do + return ark_reg_transpose_generic(cmd, msgArgs, st, array_dtype_0=bigint, array_nd_0=1); +registerFunction('transpose', ark_transpose_bigint_1, 'LinalgMsg', 289); + proc ark_eye_int(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.eye(cmd, msgArgs, st, array_dtype=int); registerFunction('eye', ark_eye_int, 'LinalgMsg', 26); @@ -1085,173 +1118,149 @@ proc ark_matmul_bigint_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: return LinalgMsg.matmul(cmd, msgArgs, st, array_dtype_x1=bigint, array_dtype_x2=bigint, array_nd=1); registerFunction('matmul', ark_matmul_bigint_bigint_1, 'LinalgMsg', 165); -proc ark_transpose_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do - return LinalgMsg.transpose(cmd, msgArgs, st, array_dtype=int, array_nd=1); -registerFunction('transpose', ark_transpose_int_1, 'LinalgMsg', 289); - -proc ark_transpose_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do - return LinalgMsg.transpose(cmd, msgArgs, st, array_dtype=uint, array_nd=1); -registerFunction('transpose', ark_transpose_uint_1, 'LinalgMsg', 289); - -proc ark_transpose_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do - return LinalgMsg.transpose(cmd, msgArgs, st, array_dtype=uint(8), array_nd=1); -registerFunction('transpose', ark_transpose_uint8_1, 'LinalgMsg', 289); - -proc ark_transpose_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do - return LinalgMsg.transpose(cmd, msgArgs, st, array_dtype=real, array_nd=1); -registerFunction('transpose', ark_transpose_real_1, 'LinalgMsg', 289); - -proc ark_transpose_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do - return LinalgMsg.transpose(cmd, msgArgs, st, array_dtype=bool, array_nd=1); -registerFunction('transpose', ark_transpose_bool_1, 'LinalgMsg', 289); - -proc ark_transpose_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do - return LinalgMsg.transpose(cmd, msgArgs, st, array_dtype=bigint, array_nd=1); -registerFunction('transpose', ark_transpose_bigint_1, 'LinalgMsg', 289); - proc ark_vecdot_int_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=int, array_dtype_x2=int, array_nd=1); -registerFunction('vecdot', ark_vecdot_int_int_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_int_int_1, 'LinalgMsg', 318); proc ark_vecdot_int_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=int, array_dtype_x2=uint, array_nd=1); -registerFunction('vecdot', ark_vecdot_int_uint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_int_uint_1, 'LinalgMsg', 318); proc ark_vecdot_int_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=int, array_dtype_x2=uint(8), array_nd=1); -registerFunction('vecdot', ark_vecdot_int_uint8_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_int_uint8_1, 'LinalgMsg', 318); proc ark_vecdot_int_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=int, array_dtype_x2=real, array_nd=1); -registerFunction('vecdot', ark_vecdot_int_real_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_int_real_1, 'LinalgMsg', 318); proc ark_vecdot_int_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=int, array_dtype_x2=bool, array_nd=1); -registerFunction('vecdot', ark_vecdot_int_bool_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_int_bool_1, 'LinalgMsg', 318); proc ark_vecdot_int_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=int, array_dtype_x2=bigint, array_nd=1); -registerFunction('vecdot', ark_vecdot_int_bigint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_int_bigint_1, 'LinalgMsg', 318); proc ark_vecdot_uint_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint, array_dtype_x2=int, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint_int_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint_int_1, 'LinalgMsg', 318); proc ark_vecdot_uint_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint, array_dtype_x2=uint, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint_uint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint_uint_1, 'LinalgMsg', 318); proc ark_vecdot_uint_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint, array_dtype_x2=uint(8), array_nd=1); -registerFunction('vecdot', ark_vecdot_uint_uint8_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint_uint8_1, 'LinalgMsg', 318); proc ark_vecdot_uint_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint, array_dtype_x2=real, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint_real_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint_real_1, 'LinalgMsg', 318); proc ark_vecdot_uint_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint, array_dtype_x2=bool, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint_bool_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint_bool_1, 'LinalgMsg', 318); proc ark_vecdot_uint_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint, array_dtype_x2=bigint, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint_bigint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint_bigint_1, 'LinalgMsg', 318); proc ark_vecdot_uint8_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint(8), array_dtype_x2=int, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint8_int_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint8_int_1, 'LinalgMsg', 318); proc ark_vecdot_uint8_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint(8), array_dtype_x2=uint, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint8_uint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint8_uint_1, 'LinalgMsg', 318); proc ark_vecdot_uint8_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint(8), array_dtype_x2=uint(8), array_nd=1); -registerFunction('vecdot', ark_vecdot_uint8_uint8_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint8_uint8_1, 'LinalgMsg', 318); proc ark_vecdot_uint8_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint(8), array_dtype_x2=real, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint8_real_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint8_real_1, 'LinalgMsg', 318); proc ark_vecdot_uint8_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint(8), array_dtype_x2=bool, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint8_bool_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint8_bool_1, 'LinalgMsg', 318); proc ark_vecdot_uint8_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=uint(8), array_dtype_x2=bigint, array_nd=1); -registerFunction('vecdot', ark_vecdot_uint8_bigint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_uint8_bigint_1, 'LinalgMsg', 318); proc ark_vecdot_real_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=real, array_dtype_x2=int, array_nd=1); -registerFunction('vecdot', ark_vecdot_real_int_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_real_int_1, 'LinalgMsg', 318); proc ark_vecdot_real_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=real, array_dtype_x2=uint, array_nd=1); -registerFunction('vecdot', ark_vecdot_real_uint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_real_uint_1, 'LinalgMsg', 318); proc ark_vecdot_real_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=real, array_dtype_x2=uint(8), array_nd=1); -registerFunction('vecdot', ark_vecdot_real_uint8_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_real_uint8_1, 'LinalgMsg', 318); proc ark_vecdot_real_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=real, array_dtype_x2=real, array_nd=1); -registerFunction('vecdot', ark_vecdot_real_real_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_real_real_1, 'LinalgMsg', 318); proc ark_vecdot_real_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=real, array_dtype_x2=bool, array_nd=1); -registerFunction('vecdot', ark_vecdot_real_bool_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_real_bool_1, 'LinalgMsg', 318); proc ark_vecdot_real_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=real, array_dtype_x2=bigint, array_nd=1); -registerFunction('vecdot', ark_vecdot_real_bigint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_real_bigint_1, 'LinalgMsg', 318); proc ark_vecdot_bool_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bool, array_dtype_x2=int, array_nd=1); -registerFunction('vecdot', ark_vecdot_bool_int_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bool_int_1, 'LinalgMsg', 318); proc ark_vecdot_bool_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bool, array_dtype_x2=uint, array_nd=1); -registerFunction('vecdot', ark_vecdot_bool_uint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bool_uint_1, 'LinalgMsg', 318); proc ark_vecdot_bool_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bool, array_dtype_x2=uint(8), array_nd=1); -registerFunction('vecdot', ark_vecdot_bool_uint8_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bool_uint8_1, 'LinalgMsg', 318); proc ark_vecdot_bool_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bool, array_dtype_x2=real, array_nd=1); -registerFunction('vecdot', ark_vecdot_bool_real_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bool_real_1, 'LinalgMsg', 318); proc ark_vecdot_bool_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bool, array_dtype_x2=bool, array_nd=1); -registerFunction('vecdot', ark_vecdot_bool_bool_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bool_bool_1, 'LinalgMsg', 318); proc ark_vecdot_bool_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bool, array_dtype_x2=bigint, array_nd=1); -registerFunction('vecdot', ark_vecdot_bool_bigint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bool_bigint_1, 'LinalgMsg', 318); proc ark_vecdot_bigint_int_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bigint, array_dtype_x2=int, array_nd=1); -registerFunction('vecdot', ark_vecdot_bigint_int_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bigint_int_1, 'LinalgMsg', 318); proc ark_vecdot_bigint_uint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bigint, array_dtype_x2=uint, array_nd=1); -registerFunction('vecdot', ark_vecdot_bigint_uint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bigint_uint_1, 'LinalgMsg', 318); proc ark_vecdot_bigint_uint8_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bigint, array_dtype_x2=uint(8), array_nd=1); -registerFunction('vecdot', ark_vecdot_bigint_uint8_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bigint_uint8_1, 'LinalgMsg', 318); proc ark_vecdot_bigint_real_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bigint, array_dtype_x2=real, array_nd=1); -registerFunction('vecdot', ark_vecdot_bigint_real_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bigint_real_1, 'LinalgMsg', 318); proc ark_vecdot_bigint_bool_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bigint, array_dtype_x2=bool, array_nd=1); -registerFunction('vecdot', ark_vecdot_bigint_bool_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bigint_bool_1, 'LinalgMsg', 318); proc ark_vecdot_bigint_bigint_1(cmd: string, msgArgs: borrowed MessageArgs, st: borrowed SymTab): MsgTuple throws do return LinalgMsg.vecdot(cmd, msgArgs, st, array_dtype_x1=bigint, array_dtype_x2=bigint, array_nd=1); -registerFunction('vecdot', ark_vecdot_bigint_bigint_1, 'LinalgMsg', 337); +registerFunction('vecdot', ark_vecdot_bigint_bigint_1, 'LinalgMsg', 318); import ManipulationMsg;