Skip to content

Commit

Permalink
Don't assume stream is a compile-time constant expression (#11725)
Browse files Browse the repository at this point in the history
The stream is only `constexpr` in the default case for cudf. When compiled with PTDS (or in the future, with a custom stream) the `default_stream_value` is a constant, but not necessarily a compile-time constant.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Vukasin Milovanovic (https://github.com/vuule)
  - Bradley Dice (https://github.com/bdice)

URL: #11725
  • Loading branch information
vyasr authored Sep 21, 2022
1 parent 387c5ff commit 5c91739
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cpp/tests/io/json_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ struct JsonTest : public cudf::test::BaseFixture {

TEST_F(JsonTest, TreeRepresentation)
{
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Test input
std::string const input = R"( [{)"
Expand Down Expand Up @@ -467,7 +467,7 @@ TEST_F(JsonTest, TreeRepresentation)

TEST_F(JsonTest, TreeRepresentation2)
{
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;
// Test input: value end with comma, space, close-brace ", }"
std::string const input =
// 0 1 2 3 4 5 6 7 8 9
Expand Down Expand Up @@ -543,7 +543,7 @@ TEST_F(JsonTest, TreeRepresentation2)

TEST_F(JsonTest, TreeRepresentation3)
{
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;
// Test input: Json lines with same TreeRepresentation2 input
std::string const input =
R"( {}
Expand Down
16 changes: 8 additions & 8 deletions cpp/tests/io/nested_json_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TEST_F(JsonTest, StackContext)
using StackSymbolT = char;

// Prepare cuda stream for data transfers & kernels
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Test input
std::string const input = R"( [{)"
Expand Down Expand Up @@ -200,7 +200,7 @@ TEST_F(JsonTest, StackContextUtf8)
using StackSymbolT = char;

// Prepare cuda stream for data transfers & kernels
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Test input
std::string const input = R"([{"a":{"year":1882,"author": "Bharathi"}, {"a":"filip ʒakotɛ"}}])";
Expand Down Expand Up @@ -251,7 +251,7 @@ TEST_F(JsonTest, TokenStream)
R"("price": 8.95)"
R"(}] )";

constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Default parsing options
cudf::io::json_reader_options default_options{};
Expand Down Expand Up @@ -387,7 +387,7 @@ TEST_F(JsonTest, TokenStream2)
R"([ {}, { "a": { "y" : 6, "z": [] }}, { "a" : { "x" : 8, "y": 9}, "b" : {"x": 10 , "z": 11)"
"\n}}]";

constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Default parsing options
cudf::io::json_reader_options default_options{};
Expand Down Expand Up @@ -455,7 +455,7 @@ TEST_F(JsonTest, ExtractColumn)
using cuio_json::SymbolT;

// Prepare cuda stream for data transfers & kernels
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Default parsing options
cudf::io::json_reader_options default_options{};
Expand All @@ -481,7 +481,7 @@ TEST_F(JsonTest, ExtractColumn)
TEST_F(JsonTest, UTF_JSON)
{
// Prepare cuda stream for data transfers & kernels
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Default parsing options
cudf::io::json_reader_options default_options{};
Expand Down Expand Up @@ -524,7 +524,7 @@ TEST_F(JsonTest, ExtractColumnWithQuotes)
using cuio_json::SymbolT;

// Prepare cuda stream for data transfers & kernels
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Default parsing options
cudf::io::json_reader_options options{};
Expand Down Expand Up @@ -552,7 +552,7 @@ TEST_F(JsonTest, ExpectFailMixStructAndList)
using cuio_json::SymbolT;

// Prepare cuda stream for data transfers & kernels
constexpr auto stream = cudf::default_stream_value;
auto const stream = cudf::default_stream_value;

// Default parsing options
cudf::io::json_reader_options options{};
Expand Down

0 comments on commit 5c91739

Please sign in to comment.