Skip to content

Commit 1174a95

Browse files
committed
Fix PR comments - int->int64 + add perf test for ABS unary ops
1 parent 919ce38 commit 1174a95

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ggml/src/ggml-cuda/unary.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ static __global__ void unary_op_kernel_noncont(
100100
const int64_t ne0, const int64_t ne1, const int64_t ne2, const int64_t ne3,
101101
const int64_t nb0_x, const int64_t nb1_x, const int64_t nb2_x, const int64_t nb3_x,
102102
const int64_t nb0_d, const int64_t nb1_d, const int64_t nb2_d, const int64_t nb3_d,
103-
const int k) {
103+
const int64_t k) {
104104

105-
const int i = blockDim.x*blockIdx.x + threadIdx.x;
105+
const int64_t i = blockDim.x*blockIdx.x + threadIdx.x;
106106

107107
if (i >= k) {
108108
return;

tests/test-backend-ops.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5611,6 +5611,9 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_perf() {
56115611

56125612
test_cases.emplace_back(new test_mean(GGML_TYPE_F32, {256, 256, 3, 1}));
56135613

5614+
test_cases.emplace_back(new test_unary((ggml_unary_op) GGML_UNARY_OP_ABS, GGML_TYPE_F32, {256, 256, 3, 1}, 0));
5615+
test_cases.emplace_back(new test_unary((ggml_unary_op) GGML_UNARY_OP_ABS, GGML_TYPE_F32, {256, 256, 3, 1}, 1));
5616+
56145617
return test_cases;
56155618
}
56165619

0 commit comments

Comments
 (0)