From 65b2fa9c2b2f71c7aea53429014c886495fd1c3e Mon Sep 17 00:00:00 2001 From: nklskyoy <31723634+nklskyoy@users.noreply.github.com> Date: Fri, 28 Nov 2025 10:31:43 +0100 Subject: [PATCH] Merge pull request #28080 from nklskyoy:rotary-embedding-experiment-win-32bit Resolving failing tests of rotary embedding layer on win32 #28080 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [ ] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake --- modules/dnn/src/layers/rotary_embedding_layer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/dnn/src/layers/rotary_embedding_layer.cpp b/modules/dnn/src/layers/rotary_embedding_layer.cpp index 6e566a929f..83d0e05a01 100644 --- a/modules/dnn/src/layers/rotary_embedding_layer.cpp +++ b/modules/dnn/src/layers/rotary_embedding_layer.cpp @@ -12,7 +12,7 @@ namespace cv { namespace dnn { static void gather( - const uchar* data, const size_t* pos_ids, + const uchar* data, const int64_t* pos_ids, const int batch_size, const int seq_len, const int seq_len_max, const int dhalf, const int elem_size, uchar* out @@ -26,7 +26,7 @@ static void gather( const int t = i % seq_len; const int b = i / seq_len; - size_t pos_id = pos_ids[b * seq_len + t]; + int64_t pos_id = pos_ids[b * seq_len + t]; if (pos_id >= seq_len_max) { outOfRangeIdx = true; @@ -320,7 +320,7 @@ class RotaryEmbeddingLayerImpl CV_FINAL : public RotaryEmbeddingLayer { for (int i = 0; i < 2; ++i) { gather( - caches[i]->ptr(), position_ids.ptr(), + caches[i]->ptr(), position_ids.ptr(), batch_size, seq_len, seq_len_max, dhalf, sizeof(float), internals[i].ptr()