Yohann/support-int-types#187
Merged
Merged
Conversation
There was a problem hiding this comment.
Cpp-linter Review
Used clang-format v18.1.8
Click here for the full clang-format patch
diff --git a/src/AMSlib/AMSTensor.cpp b/src/AMSlib/AMSTensor.cpp
index 8362f41..45a41e2 100644
--- a/src/AMSlib/AMSTensor.cpp
+++ b/src/AMSlib/AMSTensor.cpp
@@ -36 +36,2 @@ bool AMSTensor::isContiguous(AMSTensor::IntDimType expected_stride) const
-namespace {
+namespace
+{
@@ -53 +54 @@ constexpr AMSDType scalar_to_ams_dtype()
-}
+} // namespace
diff --git a/src/AMSlib/wf/interface.cpp b/src/AMSlib/wf/interface.cpp
index b413f26..07a6611 100644
--- a/src/AMSlib/wf/interface.cpp
+++ b/src/AMSlib/wf/interface.cpp
@@ -105 +105,2 @@ static ams::SmallVector<ams::AMSTensor> torchToAMSTensors(
- throw std::runtime_error("torchToAMSTensors: unsupported tensor scalar type");
+ throw std::runtime_error(
+ "torchToAMSTensors: unsupported tensor scalar type");
Have any feedback or feature suggestions? Share it here.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Loic Pottier <[email protected]>
Signed-off-by: Loic Pottier <[email protected]>
Collaborator
Author
I'm adding tests. Trying to get them in before the meeting :) |
Member
|
@YohannDudouit Okay perfect, no rush. I am using your branch to fix AMS CI (on LLNL side) :) |
There was a problem hiding this comment.
Cpp-linter Review
Used clang-format v18.1.8
Click here for the full clang-format patch
diff --git a/tests/AMSlib/ams_interface/int_interface.cpp b/tests/AMSlib/ams_interface/int_interface.cpp
index b139f67..d2bf795 100644
--- a/tests/AMSlib/ams_interface/int_interface.cpp
+++ b/tests/AMSlib/ams_interface/int_interface.cpp
@@ -20,3 +20 @@ struct AMSGlobalFixture {
- AMSGlobalFixture() {
- AMSInit();
- }
+ AMSGlobalFixture() { AMSInit(); }
@@ -233,2 +231,2 @@ CATCH_TEST_CASE("AMS API: 2D int32_t tensor execution", "[ams][api][int32][2d]")
- AMSCAbstrModel model = AMSRegisterAbstractModel(
- "int32_2d_test", 1.0, "", false);
+ AMSCAbstrModel model =
+ AMSRegisterAbstractModel("int32_2d_test", 1.0, "", false);
@@ -309,2 +307,2 @@ CATCH_TEST_CASE("AMS API: Mixed type tensors", "[ams][api][mixed]")
- AMSCAbstrModel model = AMSRegisterAbstractModel(
- "mixed_test", 1.0, "", false);
+ AMSCAbstrModel model =
+ AMSRegisterAbstractModel("mixed_test", 1.0, "", false);
diff --git a/tests/AMSlib/wf/int_tensors.cpp b/tests/AMSlib/wf/int_tensors.cpp
index 608d599..3377bce 100644
--- a/tests/AMSlib/wf/int_tensors.cpp
+++ b/tests/AMSlib/wf/int_tensors.cpp
@@ -25 +25,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor creation and basic properties",
- const auto device = GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
+ const auto device =
+ GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
@@ -83 +84,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor creation and basic properties",
- const auto device = GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
+ const auto device =
+ GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
@@ -118 +120,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor creation and basic properties",
-CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int32][view]")
+CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations",
+ "[ams][tensor][int32][view]")
@@ -130 +133,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int3
- auto tensor_view = AMSTensor::view<int32_t>(data.data(), shape, strides, device);
+ auto tensor_view =
+ AMSTensor::view<int32_t>(data.data(), shape, strides, device);
@@ -149 +153,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int3
- auto tensor_view = AMSTensor::view<int32_t>(data.data(), shape, strides, device);
+ auto tensor_view =
+ AMSTensor::view<int32_t>(data.data(), shape, strides, device);
@@ -162 +167,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int3
-CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations", "[ams][tensor][int64][view]")
+CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations",
+ "[ams][tensor][int64][view]")
@@ -174 +180,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations", "[ams][tensor][int6
- auto tensor_view = AMSTensor::view<int64_t>(data.data(), shape, strides, device);
+ auto tensor_view =
+ AMSTensor::view<int64_t>(data.data(), shape, strides, device);
@@ -185 +192,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations", "[ams][tensor][int6
-CATCH_TEST_CASE("AMSTensor: int tensor transpose operations", "[ams][tensor][transpose]")
+CATCH_TEST_CASE("AMSTensor: int tensor transpose operations",
+ "[ams][tensor][transpose]")
@@ -259 +267,2 @@ CATCH_TEST_CASE("AMSTensor: int tensor move semantics", "[ams][tensor][move]")
-CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types", "[ams][utils]")
+CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types",
+ "[ams][utils]")
@@ -282 +291 @@ CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types", "[ams][utils]"
- CATCH_REQUIRE(size_int32 == size_float); // Both 4 bytes
+ CATCH_REQUIRE(size_int32 == size_float); // Both 4 bytes
@@ -288 +297,2 @@ CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types", "[ams][utils]"
-CATCH_TEST_CASE("AMSTensor: SmallVector of int tensors", "[ams][tensor][smallvector]")
+CATCH_TEST_CASE("AMSTensor: SmallVector of int tensors",
+ "[ams][tensor][smallvector]")
Have any feedback or feature suggestions? Share it here.
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>
There was a problem hiding this comment.
Cpp-linter Review
Used clang-format v18.1.8
Click here for the full clang-format patch
diff --git a/tests/AMSlib/ams_interface/int_interface.cpp b/tests/AMSlib/ams_interface/int_interface.cpp
index 7defa67..d2bf795 100644
--- a/tests/AMSlib/ams_interface/int_interface.cpp
+++ b/tests/AMSlib/ams_interface/int_interface.cpp
@@ -231,2 +231,2 @@ CATCH_TEST_CASE("AMS API: 2D int32_t tensor execution", "[ams][api][int32][2d]")
- AMSCAbstrModel model = AMSRegisterAbstractModel(
- "int32_2d_test", 1.0, "", false);
+ AMSCAbstrModel model =
+ AMSRegisterAbstractModel("int32_2d_test", 1.0, "", false);
@@ -307,2 +307,2 @@ CATCH_TEST_CASE("AMS API: Mixed type tensors", "[ams][api][mixed]")
- AMSCAbstrModel model = AMSRegisterAbstractModel(
- "mixed_test", 1.0, "", false);
+ AMSCAbstrModel model =
+ AMSRegisterAbstractModel("mixed_test", 1.0, "", false);
diff --git a/tests/AMSlib/wf/int_tensors.cpp b/tests/AMSlib/wf/int_tensors.cpp
index 608d599..3377bce 100644
--- a/tests/AMSlib/wf/int_tensors.cpp
+++ b/tests/AMSlib/wf/int_tensors.cpp
@@ -25 +25,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor creation and basic properties",
- const auto device = GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
+ const auto device =
+ GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
@@ -83 +84,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor creation and basic properties",
- const auto device = GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
+ const auto device =
+ GENERATE(AMSResourceType::AMS_HOST, AMSResourceType::AMS_DEVICE);
@@ -118 +120,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor creation and basic properties",
-CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int32][view]")
+CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations",
+ "[ams][tensor][int32][view]")
@@ -130 +133,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int3
- auto tensor_view = AMSTensor::view<int32_t>(data.data(), shape, strides, device);
+ auto tensor_view =
+ AMSTensor::view<int32_t>(data.data(), shape, strides, device);
@@ -149 +153,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int3
- auto tensor_view = AMSTensor::view<int32_t>(data.data(), shape, strides, device);
+ auto tensor_view =
+ AMSTensor::view<int32_t>(data.data(), shape, strides, device);
@@ -162 +167,2 @@ CATCH_TEST_CASE("AMSTensor: int32_t tensor view operations", "[ams][tensor][int3
-CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations", "[ams][tensor][int64][view]")
+CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations",
+ "[ams][tensor][int64][view]")
@@ -174 +180,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations", "[ams][tensor][int6
- auto tensor_view = AMSTensor::view<int64_t>(data.data(), shape, strides, device);
+ auto tensor_view =
+ AMSTensor::view<int64_t>(data.data(), shape, strides, device);
@@ -185 +192,2 @@ CATCH_TEST_CASE("AMSTensor: int64_t tensor view operations", "[ams][tensor][int6
-CATCH_TEST_CASE("AMSTensor: int tensor transpose operations", "[ams][tensor][transpose]")
+CATCH_TEST_CASE("AMSTensor: int tensor transpose operations",
+ "[ams][tensor][transpose]")
@@ -259 +267,2 @@ CATCH_TEST_CASE("AMSTensor: int tensor move semantics", "[ams][tensor][move]")
-CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types", "[ams][utils]")
+CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types",
+ "[ams][utils]")
@@ -282 +291 @@ CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types", "[ams][utils]"
- CATCH_REQUIRE(size_int32 == size_float); // Both 4 bytes
+ CATCH_REQUIRE(size_int32 == size_float); // Both 4 bytes
@@ -288 +297,2 @@ CATCH_TEST_CASE("AMSTensor: dtype_to_size utility for int types", "[ams][utils]"
-CATCH_TEST_CASE("AMSTensor: SmallVector of int tensors", "[ams][tensor][smallvector]")
+CATCH_TEST_CASE("AMSTensor: SmallVector of int tensors",
+ "[ams][tensor][smallvector]")
Have any feedback or feature suggestions? Share it here.
lpottier
reviewed
Apr 10, 2026
lpottier
reviewed
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for
int32_tandint64_tas "scalar" types forAMSTensor.Also fix an unrelated minor bug in eos_ams, where the
densitywas used twice instead of theenergy.