From 163ab5f04be21dab2cfbaa8e8737c1e3bee086c2 Mon Sep 17 00:00:00 2001 From: Yogesh Tyagi Date: Tue, 12 Aug 2025 11:17:43 +0800 Subject: [PATCH] rkcommon : fix test, use fully-qualified rkcommon::math::rsqrt to avoid overload ambiguity Signed-off-by: Yogesh Tyagi Signed-off-by: Anuj Mittal --- ...ied-rkcommon-math-rsqrt-to-avoid-ove.patch | 49 +++++++++++++++++++ .../rkcommon/rkcommon_1.14.0.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/files/0001-use-fully-qualified-rkcommon-math-rsqrt-to-avoid-ove.patch diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/files/0001-use-fully-qualified-rkcommon-math-rsqrt-to-avoid-ove.patch b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/files/0001-use-fully-qualified-rkcommon-math-rsqrt-to-avoid-ove.patch new file mode 100644 index 00000000..5aef2b76 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/files/0001-use-fully-qualified-rkcommon-math-rsqrt-to-avoid-ove.patch @@ -0,0 +1,49 @@ +From f0885d7d97e98ad586bbacf5edf7fa4022b425b9 Mon Sep 17 00:00:00 2001 +From: Yogesh Tyagi +Date: Mon, 11 Aug 2025 14:00:50 +0800 +Subject: [PATCH] use fully-qualified rkcommon::math::rsqrt to avoid overload + ambiguity + +Explicitly calling rkcommon::math::rsqrt() prevents conflict with the +standard rsqrt(double) declared in bits/mathcalls.h, fixing the build +error in Quaternion tests. + +Signed-off-by: Yogesh Tyagi + +Upstream-Status: Submitted [https://github.com/RenderKit/rkcommon/pull/16] +--- + tests/math/test_Quaternion.cpp | 2 +- + tests/math/test_rkmath.cpp | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/math/test_Quaternion.cpp b/tests/math/test_Quaternion.cpp +index 760d815..f527824 100644 +--- a/tests/math/test_Quaternion.cpp ++++ b/tests/math/test_Quaternion.cpp +@@ -187,7 +187,7 @@ template + inline void test_slerp() + { + typename T::Scalar two = 2; +- REQUIRE(CmpT(slerp(.5f, T(1, 0, 0, 0), T(0, 1, 0, 0)), T(rsqrt(two), rsqrt(two), 0, 0))); ++ REQUIRE(CmpT(slerp(.5f, T(1, 0, 0, 0), T(0, 1, 0, 0)), T(rkcommon::math::rsqrt(two), rkcommon::math::rsqrt(two), 0, 0))); + } + + TEST_CASE("Quaternion functions", "[quat]") +diff --git a/tests/math/test_rkmath.cpp b/tests/math/test_rkmath.cpp +index 7f66532..fd18df4 100644 +--- a/tests/math/test_rkmath.cpp ++++ b/tests/math/test_rkmath.cpp +@@ -49,8 +49,8 @@ TEST_CASE("rkmath rcp_safe function", "[rkmath]") + template + inline void test_rsqrt() + { +- REQUIRE(CmpT(rsqrt(T(1)), T(1))); +- REQUIRE(CmpT(rsqrt(T(4)), T(.5))); ++ REQUIRE(CmpT(rkcommon::math::rsqrt(T(1)), T(1))); ++ REQUIRE(CmpT(rkcommon::math::rsqrt(T(4)), T(.5))); + } + + TEST_CASE("rkmath rsqrt function", "[rkmath]") +-- +2.37.3 + diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.14.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.14.0.bb index 5289e9eb..d49e8e52 100644 --- a/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.14.0.bb +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.14.0.bb @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" inherit pkgconfig cmake SRC_URI = "git://github.com/ospray/rkcommon.git;protocol=https;branch=master \ + file://0001-use-fully-qualified-rkcommon-math-rsqrt-to-avoid-ove.patch \ " SRCREV = "4a00047ae5a3ac705b6b33b4a7574588d91e7953"