2 lines
28 KiB
JSON
2 lines
28 KiB
JSON
{"source_sha256": "bf78eee5cf96ea7c112c4e61546c12bcacf57fe512e0572182604cb94137510b", "kernels": "[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_contiguous\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_contiguous(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device bfloat16_t* C [[buffer(2)]],\n constant const uint& size [[buffer(3)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = N_ * pos.x;\n bfloat16_t tmp_A = A[index];\n bfloat16_t tmp_B = B[index];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_contiguous_n\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_contiguous_n(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device bfloat16_t* C [[buffer(2)]],\n constant const uint& size [[buffer(3)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n uint index = N_ * pos.x;\n for (int i = 0; i < N_ && index < size; ++i) {\n bfloat16_t tmp_A = A[index];\n bfloat16_t tmp_B = B[index];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_contiguous_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_contiguous_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n device bfloat16_t* C [[buffer(2)]],\n constant const int64_t& size [[buffer(3)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int64_t index = N_ * (pos.x + grid.x * int64_t(pos.y));\n for (int i = 0; i < N_ && index < size; ++i) {\n bfloat16_t tmp_A = A[index];\n bfloat16_t tmp_B = B[index];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_1\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_1(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = pos.x + grid.x * (pos.y + uint(grid.y) * pos.z);\n uint index_A = elem_to_loc_1<uint>(pos.x, in_strides[0]);\n uint index_B = elem_to_loc_1<uint>(pos.x, in_strides[1]);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_1_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_1_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n int64_t index = pos.x + grid.x * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = elem_to_loc_1<int64_t>(pos.x, in_strides[0]);\n int64_t index_B = elem_to_loc_1<int64_t>(pos.x, in_strides[1]);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_2\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_2(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = pos.x + grid.x * (pos.y + uint(grid.y) * pos.z);\n uint index_A = elem_to_loc_2<uint>({pos.x, pos.y}, in_strides + 0);\n uint index_B = elem_to_loc_2<uint>({pos.x, pos.y}, in_strides + 2);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_2_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_2_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n int64_t index = pos.x + grid.x * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = elem_to_loc_2<int64_t>({pos.x, pos.y}, in_strides + 0);\n int64_t index_B = elem_to_loc_2<int64_t>({pos.x, pos.y}, in_strides + 2);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_3\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_3(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n uint index = pos.x + grid.x * (pos.y + uint(grid.y) * pos.z);\n uint index_A = elem_to_loc_3<uint>(pos, in_strides + 0);\n uint index_B = elem_to_loc_3<uint>(pos, in_strides + 3);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_3_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_3_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 1;\n int64_t index = pos.x + grid.x * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = elem_to_loc_3<int64_t>(pos, in_strides + 0);\n int64_t index_B = elem_to_loc_3<int64_t>(pos, in_strides + 3);\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_4\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_4(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[3];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n uint index_A = N_ * pos.x * uint(in_strides[3]) + pos.y * uint(in_strides[2]);\n uint index_B = N_ * pos.x * uint(in_strides[7]) + pos.y * uint(in_strides[6]);\n uint zpos = pos.z;\n for (int d = 1; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[4 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[3];\n index_B += in_strides[7];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_4_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_4_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[3];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[3]) + pos.y * int64_t(in_strides[2]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[7]) + pos.y * int64_t(in_strides[6]);\n uint zpos = pos.z;\n for (int d = 1; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[4 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[3];\n index_B += in_strides[7];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_5\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_5(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[4];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n uint index_A = N_ * pos.x * uint(in_strides[4]) + pos.y * uint(in_strides[3]);\n uint index_B = N_ * pos.x * uint(in_strides[9]) + pos.y * uint(in_strides[8]);\n uint zpos = pos.z;\n for (int d = 2; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[5 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[4];\n index_B += in_strides[9];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_5_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_5_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[4];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[4]) + pos.y * int64_t(in_strides[3]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[9]) + pos.y * int64_t(in_strides[8]);\n uint zpos = pos.z;\n for (int d = 2; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[5 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[4];\n index_B += in_strides[9];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_6\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_6(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[5];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n uint index_A = N_ * pos.x * uint(in_strides[5]) + pos.y * uint(in_strides[4]);\n uint index_B = N_ * pos.x * uint(in_strides[11]) + pos.y * uint(in_strides[10]);\n uint zpos = pos.z;\n for (int d = 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[6 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[5];\n index_B += in_strides[11];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_6_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_6_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[5];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[5]) + pos.y * int64_t(in_strides[4]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[11]) + pos.y * int64_t(in_strides[10]);\n uint zpos = pos.z;\n for (int d = 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[6 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[5];\n index_B += in_strides[11];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_7\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_7(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[6];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n uint index_A = N_ * pos.x * uint(in_strides[6]) + pos.y * uint(in_strides[5]);\n uint index_B = N_ * pos.x * uint(in_strides[13]) + pos.y * uint(in_strides[12]);\n uint zpos = pos.z;\n for (int d = 4; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 + d]);\n index_B += l * uint(in_strides[7 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[6];\n index_B += in_strides[13];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_7_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_7_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[6];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[6]) + pos.y * int64_t(in_strides[5]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[13]) + pos.y * int64_t(in_strides[12]);\n uint zpos = pos.z;\n for (int d = 4; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 + d]);\n index_B += l * int64_t(in_strides[7 + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[6];\n index_B += in_strides[13];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_dynamic\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_dynamic(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n constant const int& ndim [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 2;\n int xshape = output_shape[ndim - 1];\n uint index = N_ * pos.x + xshape * (pos.y + uint(grid.y) * pos.z);\n uint index_A = N_ * pos.x * uint(in_strides[ndim * 0 + ndim - 1]) + pos.y * uint(in_strides[ndim * 0 + ndim - 2]);\n uint index_B = N_ * pos.x * uint(in_strides[ndim * 1 + ndim - 1]) + pos.y * uint(in_strides[ndim * 1 + ndim - 2]);\n uint zpos = pos.z;\n for (int d = ndim - 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * uint(in_strides[0 * ndim + d]);\n index_B += l * uint(in_strides[1 * ndim + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[0 * ndim + ndim - 1];\n index_B += in_strides[1 * ndim + ndim - 1];\n index++;\n }\n}\n[[host_name(\"CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_dynamic_large\")]]\n[[kernel]] void CV2ISigmoidADV2IBroadcastACEV2IBroadcastCAFV2IMultiplyDEGV2IBroadcastFBHV2IBroadcastBFIV2OMultiplyGH_VV_V2V2_11160318154034397263_strided_dynamic_large(\n device const bfloat16_t* A [[buffer(0)]],\n device const bfloat16_t* B [[buffer(1)]],\n constant const int64_t* in_strides [[buffer(2)]],\n device bfloat16_t* C [[buffer(3)]],\n constant const int* output_shape [[buffer(4)]],\n constant const int& ndim [[buffer(5)]],\n uint3 pos [[thread_position_in_grid]],\n uint3 grid [[threads_per_grid]]) {\n constexpr int N_ = 4;\n int xshape = output_shape[ndim - 1];\n int64_t index = N_ * pos.x + xshape * (pos.y + int64_t(grid.y) * pos.z);\n int64_t index_A = N_ * pos.x * int64_t(in_strides[ndim * 0 + ndim - 1]) + pos.y * int64_t(in_strides[ndim * 0 + ndim - 2]);\n int64_t index_B = N_ * pos.x * int64_t(in_strides[ndim * 1 + ndim - 1]) + pos.y * int64_t(in_strides[ndim * 1 + ndim - 2]);\n uint zpos = pos.z;\n for (int d = ndim - 3; d >= 0; --d) {\n uint l = zpos % output_shape[d];\n index_A += l * int64_t(in_strides[0 * ndim + d]);\n index_B += l * int64_t(in_strides[1 * ndim + d]);\n zpos /= output_shape[d];\n }\n for (int i = 0; i < N_ && (int(N_ * pos.x) + i) < xshape; ++i) {\n bfloat16_t tmp_A = A[index_A];\n bfloat16_t tmp_B = B[index_B];\n bfloat16_t tmp_D = Sigmoid()(tmp_A);\n bfloat16_t tmp_E = cast_to<bfloat16_t>(tmp_A);\n bfloat16_t tmp_F = cast_to<bfloat16_t>(tmp_D);\n bfloat16_t tmp_G = Multiply()(tmp_E, tmp_F);\n bfloat16_t tmp_H = cast_to<bfloat16_t>(tmp_G);\n bfloat16_t tmp_I = cast_to<bfloat16_t>(tmp_B);\n bfloat16_t tmp_C = Multiply()(tmp_H, tmp_I);\n C[index] = tmp_C;\n index_A += in_strides[0 * ndim + ndim - 1];\n index_B += in_strides[1 * ndim + ndim - 1];\n index++;\n }\n}\n"}
|