diff --git a/test-project/binaries/dml-test b/test-project/binaries/dml-test index e9bdea6..bf1aac1 100755 Binary files a/test-project/binaries/dml-test and b/test-project/binaries/dml-test differ diff --git a/test-project/main.cpp b/test-project/main.cpp index 7779247..816ff83 100644 --- a/test-project/main.cpp +++ b/test-project/main.cpp @@ -1,30 +1,29 @@ #include - -#include -#include +#include #include +#include -constexpr auto string = "Calculate CRC value for this string...\n"; +constexpr auto size = 1024u; template -int execute_copy_crc(){ - std::cout << "Starting dml::copy_crc example...\n"; - std::cout << string; +int execute_mem_move() { + std::cout << "Starting dml::mem_move example..." << std::endl; + std::cout << "Copy 1KB of data from source into destination..." << std::endl; // Prepare data - auto crc_seed = std::uint32_t(0u); - auto src = std::basic_string(reinterpret_cast(string)); - auto dst = std::basic_string(src.size(), '0'); + auto src = std::vector(size); + std::iota(src.begin(), src.end(), 0u); + auto dst = std::vector(size, 0u); // Run operation - auto result = dml::execute(dml::copy_crc, dml::make_view(src), dml::make_view(dst), crc_seed); + auto result = dml::execute(dml::mem_move, dml::make_view(src), dml::make_view(dst)); // Check result if (result.status == dml::status_code::ok) { - std::cout << "Finished successfully. Calculated CRC is: 0x" << std::hex << result.crc_value << std::dec << std::endl; + std::cout << "Finished successfully." << std::endl; } else { - std::cout << "Failure #" << static_cast(result.status) << " occurred." << std::endl; + std::cout << "Failure occurred." << std::endl; return -1; } @@ -47,15 +46,15 @@ int main(int argc, char **argv) std::string path = argv[1]; if (path == "hardware_path") { std::cout << "Executing using dml::hardware path" << std::endl; - return execute_copy_crc(); + return execute_mem_move(); } else if (path == "software_path") { std::cout << "Executing using dml::software path" << std::endl; - return execute_copy_crc(); + return execute_mem_move(); } else if (path == "auto_path") { std::cout << "Executing using dml::automatic path" << std::endl; - return execute_copy_crc(); + return execute_mem_move(); } else { std::cout << "Unrecognized value for parameter."