Copilot commented on code in PR #13067:
URL: https://github.com/apache/gluten/pull/13067#discussion_r4199070331


##########
cpp/velox/tests/ValueStreamDynamicFilterTest.cc:
##########
@@ -24,6 +24,11 @@
 #include "velox/vector/FlatVector.h"
 #include "velox/vector/tests/utils/VectorTestBase.h"
 
+#ifdef GLUTEN_ENABLE_GPU
+#include "operators/plannodes/CudfVectorStream.h"
+#include "velox/experimental/cudf/vector/CudfVector.h"

Review Comment:
   These includes bring cuDF/RMM headers into `velox_operators_test`, but that 
target uses `add_velox_test` and lacks 
`LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE`. The definition on `velox` is 
PRIVATE (`cpp/velox/CMakeLists.txt:578-579`), so it does not propagate to this 
test. Add the required definition to `velox_operators_test` under `ENABLE_GPU`, 
or move these GPU cases into an `add_velox_gpu_test` target, which already 
supplies it, to avoid breaking GPU-enabled test compilation.



##########
cpp/velox/operators/plannodes/CudfVectorStream.h:
##########
@@ -115,11 +116,30 @@ class CudfVectorStream : public CudfVectorStreamBase {
     VELOX_DCHECK(vp != nullptr);
     auto cudfVector = 
std::dynamic_pointer_cast<facebook::velox::cudf_velox::CudfVector>(vp);
     if (cudfVector == nullptr) {
-      // The vector may comes from BroadcastExchange, in this case, it's not a 
CudfVector.
-      vp->setType(outputType_);
-      return vp;
+      // BroadcastExchange may return a host RowVector; upload it for GPU 
operators.
+      auto stream = 
facebook::velox::cudf_velox::cudfGlobalStreamPool().get_stream();
+      if (vp->childrenSize() == 0 || outputType_->size() == 0) {

Review Comment:
   A zero-child host batch enters this branch even when `outputType_` declares 
columns. This bypasses the column-count check below and constructs a 
`CudfVector` with a nonempty schema but no physical columns. Restrict the 
special case to an empty output schema so missing input columns are rejected by 
the existing check instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to