-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63a84c8
commit 8c066aa
Showing
4 changed files
with
15 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#include <gtest/gtest.h> | ||
#include <generators.h> | ||
#include <iostream> | ||
// #include "tests.cpp" | ||
// #include "c_api.cpp" | ||
|
||
extern std::unique_ptr<OrtEnv> g_ort_env; | ||
|
||
void Test_GreedySearch_Gpt_Fp32_C_API(); | ||
void Test_GreedySearch_Gpt_Fp32(); | ||
void Test_BeamSearch_Gpt_Fp32(); | ||
|
||
#if USE_CUDA | ||
void Test_GreedySearch_Gpt_Cuda(); | ||
void Test_BeamSearch_Gpt_Cuda(); | ||
#endif | ||
|
||
int main() { | ||
int main(int argc, char **argv) { | ||
std::cout << "Generators Utility Library" << std::endl; | ||
|
||
try { | ||
|
||
std::cout << "Initializing OnnxRuntime..."; | ||
std::cout.flush(); | ||
Ort::InitApi(); | ||
g_ort_env = OrtEnv::Create(); | ||
std::cout << "done" << std::endl; | ||
|
||
Test_GreedySearch_Gpt_Fp32_C_API(); | ||
Test_GreedySearch_Gpt_Fp32(); | ||
Test_BeamSearch_Gpt_Fp32(); | ||
|
||
#if USE_CUDA | ||
Test_GreedySearch_Gpt_Cuda(); | ||
Test_BeamSearch_Gpt_Cuda(); | ||
#endif | ||
} catch (const std::exception& e) { | ||
std::cout << "Fatal Exception: " << e.what() << std::endl; | ||
} | ||
return 0; | ||
} | ||
std::cout << "Initializing OnnxRuntime... "; | ||
std::cout.flush(); | ||
Ort::InitApi(); | ||
g_ort_env = OrtEnv::Create(); | ||
std::cout << "done" << std::endl; | ||
::testing::InitGoogleTest(&argc, argv); | ||
int result = RUN_ALL_TESTS(); | ||
std::cout << "Shutting down OnnxRuntime... "; | ||
g_ort_env.release(); | ||
std::cout << "done" << std::endl; | ||
return result; | ||
} |
This file was deleted.
Oops, something went wrong.