diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 14:53:01 -0500 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 14:54:13 -0500 |
| commit | a8e99f3a783069cf85b626c6cfb2fbe83ae4fd44 (patch) | |
| tree | 8322b0d20dd02660c3f26fcfd37c2cc4dcd33cda /examples/opt/opt.cc | |
| parent | 463a0c01f96d86c9c91f02903bc1d194c5e55b15 (diff) | |
chore: new version of OCL and codebase cleanup.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples/opt/opt.cc')
| -rw-r--r-- | examples/opt/opt.cc | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/examples/opt/opt.cc b/examples/opt/opt.cc deleted file mode 100644 index dbeab2f..0000000 --- a/examples/opt/opt.cc +++ /dev/null @@ -1,45 +0,0 @@ -/* - String checksum example - Written by Amlal El Mahrouss. - Licensed under the Boost Software License - */ - -#include <logic/opt.hpp> -#include <io/print.hpp> -#include <utility/crc32.hpp> -#include <string> - -static const char do_hash(const std::string& in) -{ - int hash = 0; - - for (long index = 0; index < in.size(); ++index) - { - hash += in[index]; - } - - return hash; -} - -static auto do_some(const std::string recv_data, const std::string check_data) -{ - const int hash_to_check = do_hash(check_data); /* here we assume this should match opt_hash */ - const int opt_hash = do_hash(recv_data); /* we assume that the hash is correct */ - - auto opt = ocl::opt(ocl::eval_eq(hash_to_check, opt_hash)); /* do the compute */ - return opt; -} - -/* finally test it */ -int main(int argc, char** argv) -{ - // ... let's assume we fetch data from network... - - ocl::io::println("Testing data..."); - - auto opt = do_some("Foo", "Foo"); - opt.expect("Checksum failed, Foo isn't Foo!"); - - - return 0; -} |
