Skip to content

Comments

fix(sysrap): avoid std::lerp conflict by namespacing lerp#203

Merged
plexoos merged 6 commits intomainfrom
fix-lerp
Feb 13, 2026
Merged

fix(sysrap): avoid std::lerp conflict by namespacing lerp#203
plexoos merged 6 commits intomainfrom
fix-lerp

Conversation

@plexoos
Copy link
Member

@plexoos plexoos commented Feb 13, 2026

Copilot AI review requested due to automatic review settings February 13, 2026 18:19
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/sysrap/SRecord.h b/sysrap/SRecord.h
index 782be77..9f8eab5 100644
--- a/sysrap/SRecord.h
+++ b/sysrap/SRecord.h
@@ -396 +396 @@ inline bool SRecord::FindInterpolatedPhotonFromRecordAtTime( sphoton& p, const s
-            p.pos = sysrap::lerp( p0.pos, p1.pos, frac ) ; // interpolated position
+            p.pos = sysrap::lerp(p0.pos, p1.pos, frac); // interpolated position
diff --git a/sysrap/scuda.h b/sysrap/scuda.h
index 5d21556..6e2bc5f 100644
--- a/sysrap/scuda.h
+++ b/sysrap/scuda.h
@@ -128 +128,2 @@ SUTIL_INLINE SUTIL_HOSTDEVICE unsigned long long min(unsigned long long a, unsig
-namespace sysrap { // avoid name conflict with std::lerp function
+namespace sysrap
+{ // avoid name conflict with std::lerp function
@@ -146 +147 @@ SUTIL_INLINE SUTIL_HOSTDEVICE float bilerp(const float x00, const float x10, con
-}
+} // namespace sysrap

Have any feedback or feature suggestions? Share it here.

plexoos and others added 2 commits February 13, 2026 13:20
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot dismissed their stale review February 13, 2026 18:21

outdated suggestion

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/sysrap/SRecord.h b/sysrap/SRecord.h
index 782be77..9f8eab5 100644
--- a/sysrap/SRecord.h
+++ b/sysrap/SRecord.h
@@ -396 +396 @@ inline bool SRecord::FindInterpolatedPhotonFromRecordAtTime( sphoton& p, const s
-            p.pos = sysrap::lerp( p0.pos, p1.pos, frac ) ; // interpolated position
+            p.pos = sysrap::lerp(p0.pos, p1.pos, frac); // interpolated position
diff --git a/sysrap/scuda.h b/sysrap/scuda.h
index 3b386ba..6e2bc5f 100644
--- a/sysrap/scuda.h
+++ b/sysrap/scuda.h
@@ -128 +128,2 @@ SUTIL_INLINE SUTIL_HOSTDEVICE unsigned long long min(unsigned long long a, unsig
-namespace sysrap { // avoid name conflict with std::lerp function
+namespace sysrap
+{ // avoid name conflict with std::lerp function

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review February 13, 2026 18:21

outdated suggestion

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to fix a potential naming conflict between std::lerp (introduced in C++20) and the custom lerp function by wrapping it in a sysrap namespace. However, the implementation is incomplete.

Changes:

  • Added a sysrap namespace around the float version of lerp and bilerp functions in sysrap/scuda.h
  • Updated one call site in sysrap/SRecord.h to use sysrap::lerp with the namespace qualifier

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
sysrap/scuda.h Added sysrap namespace around the float versions of lerp and bilerp (lines 128-146)
sysrap/SRecord.h Updated lerp call to use sysrap:: namespace qualifier

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/sysrap/scuda.h b/sysrap/scuda.h
index 4eef533..bee2f67 100644
--- a/sysrap/scuda.h
+++ b/sysrap/scuda.h
@@ -132,8 +132,5 @@ namespace sysrap
-/** lerp */
-SUTIL_INLINE SUTIL_HOSTDEVICE float lerp(const float a, const float b, const float t)
-{
-  return a + t*(b-a);
-}
-
-
-
+    /** lerp */
+    SUTIL_INLINE SUTIL_HOSTDEVICE float lerp(const float a, const float b, const float t)
+    {
+        return a + t * (b - a);
+    }
@@ -141,6 +138,6 @@ SUTIL_INLINE SUTIL_HOSTDEVICE float lerp(const float a, const float b, const flo
-/** bilerp */
-SUTIL_INLINE SUTIL_HOSTDEVICE float bilerp(const float x00, const float x10, const float x01, const float x11,
-                                         const float u, const float v)
-{
-  return lerp( lerp( x00, x10, u ), lerp( x01, x11, u ), v );
-}
+    /** bilerp */
+    SUTIL_INLINE SUTIL_HOSTDEVICE float bilerp(const float x00, const float x10, const float x01, const float x11,
+                                               const float u, const float v)
+    {
+        return lerp(lerp(x00, x10, u), lerp(x01, x11, u), v);
+    }

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review February 13, 2026 18:23

outdated suggestion

@plexoos plexoos merged commit 073ac31 into main Feb 13, 2026
3 checks passed
@plexoos plexoos deleted the fix-lerp branch February 13, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function definition clash when compiling with C++20

1 participant