Skip to content

Commit db0c041

Browse files
committed
Use plain void legate::start() (old function ignored args anyway)
Legate has auto-configure now and LEGATE_CONFIG or the legate must be used. This was always ignored, and I am not sure that the return value was used (or an exception was raised anyway). Now, an exception should be raised, which should be OK everywhere. Signed-off-by: Sebastian Berg <[email protected]>
1 parent 96bb744 commit db0c041

File tree

4 files changed

+9
-29
lines changed

4 files changed

+9
-29
lines changed

Diff for: README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,8 @@ if __name__ == "__main__":
121121

122122
int main(int argc, char** argv)
123123
{
124-
// First we initialize Legate and cuPyNumeric
125-
int32_t errcode = legate::start(argc, argv);
126-
if (errcode != 0) {
127-
throw std::runtime_error("legate::start() errorcode: " + std::to_string(errcode));
128-
}
124+
// First we initialize Legate use either `legate` or `LEGATE_CONFIG` to customize launch
125+
legate::start();
129126

130127
// Then let's create a new logical column
131128
legate::dataframe::LogicalColumn col_a = legate::dataframe::sequence(20, -10);

Diff for: cpp/examples/hello.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@
2424
#include <legate_dataframe/parquet.hpp>
2525
#include <legate_dataframe/unaryop.hpp>
2626

27-
int main(int argc, char** argv)
27+
int main(void)
2828
{
29-
// First we initialize Legate
30-
int32_t errcode = legate::start(argc, argv);
31-
if (errcode != 0) {
32-
throw std::runtime_error("legate::start() errorcode: " + std::to_string(errcode));
33-
}
29+
// First we initialize Legate use either `legate` or `LEGATE_CONFIG` to customize launch
30+
legate::start();
3431

3532
// Then let's create a new logical column
3633
legate::dataframe::LogicalColumn col_a = legate::dataframe::sequence(20, -10);

Diff for: cpp/examples/third_party/third_party_hello.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@
2222

2323
int main(int argc, char** argv)
2424
{
25-
// First we initialize Legate
26-
int32_t errcode = legate::start(argc, argv);
27-
if (errcode != 0) {
28-
throw std::runtime_error("legate::start() errorcode: " + std::to_string(errcode));
29-
}
25+
// First we initialize Legate use either `legate` or `LEGATE_CONFIG` to customize launch
26+
legate::start();
3027

3128
// Then let's create a new logical column
3229
legate::dataframe::LogicalColumn col_a = legate::dataframe::sequence(10, 0);

Diff for: cpp/tests/main.cpp

+2-13
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,13 @@
1919

2020
class Environment : public ::testing::Environment {
2121
public:
22-
Environment(int argc, char** argv) : argc_(argc), argv_(argv) {}
23-
24-
void SetUp() override
25-
{
26-
const char* argv[] = {"./test", "--gpus", "2"}; // TODO: make configurable
27-
int argc = 3;
28-
EXPECT_EQ(legate::start(argc, (char**)argv), 0);
29-
}
22+
void SetUp() override { legate::start(); }
3023
void TearDown() override { EXPECT_EQ(legate::finish(), 0); }
31-
32-
private:
33-
int argc_;
34-
char** argv_;
3524
};
3625

3726
int main(int argc, char** argv)
3827
{
3928
::testing::InitGoogleTest(&argc, argv);
40-
::testing::AddGlobalTestEnvironment(new Environment(argc, argv));
29+
::testing::AddGlobalTestEnvironment(new Environment());
4130
return RUN_ALL_TESTS();
4231
}

0 commit comments

Comments
 (0)