summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/ocl/allocator_op.hpp2
-rw-r--r--include/ocl/is_same.hpp23
-rw-r--r--include/ocl/unique_ptr.hpp20
-rw-r--r--tests/.gitkeep0
4 files changed, 40 insertions, 5 deletions
diff --git a/include/ocl/allocator_op.hpp b/include/ocl/allocator_op.hpp
index 9092800..eff3bac 100644
--- a/include/ocl/allocator_op.hpp
+++ b/include/ocl/allocator_op.hpp
@@ -1,6 +1,6 @@
/*
* File: allocator_op.hpp
- * Purpose: Allocator Operations container.
+ * Purpose: Allocate from a pool.
* Author: Amlal El Mahrouss (amlal@nekernel.org)
* Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. Licensed under the BSL 1.0 license
*/
diff --git a/include/ocl/is_same.hpp b/include/ocl/is_same.hpp
index de3425e..ec3eb66 100644
--- a/include/ocl/is_same.hpp
+++ b/include/ocl/is_same.hpp
@@ -68,7 +68,7 @@ namespace ocl
T left_ = 127, right_ = 127;
public:
- using result_type = T;
+ using result_type = bool;
constexpr result_type hash()
{
@@ -84,7 +84,7 @@ namespace ocl
T left_ = 127, right_ = 127;
public:
- using result_type = T;
+ using result_type = bool;
constexpr result_type hash()
{
@@ -99,11 +99,26 @@ namespace ocl
T left_ = 5, right_ = 3;
public:
- using result_type = T;
+ using result_type = bool;
constexpr result_type hash()
{
- return left_ / right_ == 1;
+ return (left_ / right_) == 1;
+ }
+ };
+
+ template <typename T>
+ struct equiv_is
+ {
+ private:
+ T left_{}, right_{};
+
+ public:
+ using result_type = bool;
+
+ constexpr result_type hash()
+ {
+ return (left_ / right_);
}
};
} // namespace ocl
diff --git a/include/ocl/unique_ptr.hpp b/include/ocl/unique_ptr.hpp
new file mode 100644
index 0000000..253fc0a
--- /dev/null
+++ b/include/ocl/unique_ptr.hpp
@@ -0,0 +1,20 @@
+/*
+ * File: unique_pr.hpp
+ * Purpose: Unique Pointer helpers.
+ * Author: Amlal El Mahrouss (amlal@nekernel.org)
+ * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. Licensed under the BSL 1.0 license
+ */
+
+#ifndef __OCL_UNIQUE_PTR
+#define __OCL_UNIQUE_PTR
+
+#include <ocl/detail/config.hpp>
+#include <memory>
+
+namespace ocl
+{
+ template<class T, class Del>
+ using unique_ptr = std::unique_ptr<T, Del>;
+}
+
+#endif // ifndef __OCL_UNIQUE_PTR \ No newline at end of file
diff --git a/tests/.gitkeep b/tests/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/tests/.gitkeep
+++ /dev/null