You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/06/22 20:48:30 UTC

[GitHub] [incubator-tvm] trevor-m commented on a change in pull request #5857: [OpenCL] Fix OpenCL get_valid_counts errors due to intrinsic atomic_add

trevor-m commented on a change in pull request #5857:
URL: https://github.com/apache/incubator-tvm/pull/5857#discussion_r443817236



##########
File path: src/target/source/codegen_opencl.cc
##########
@@ -70,6 +70,10 @@ std::string CodeGenOpenCL::Finish() {
                    "#endif\n\n";
   }
 
+  // Enable atomic_add used by get_valid_counts. Only needed for OpenCL < 1.1.

Review comment:
       Thanks @wpan11nv for reviewing! I touched on this in the description:
   
   > Enable cl_khr_global_int32_base_atomics. This isn't required for OpenCL 1.1+ because atomic_add became a core feature. I'm happy to remove this if we don't care about OpenCL 1.0. Alternatively we can override op->call_type == CallNode::PureExtern and set a flag to enable this only when atomic_add is actually used.
   
   I can definitely add a flag but it would require us to override `VisitExpr()` for `CallNode::PureExtern` just to check if atomic_add is used. Do you think I should do that?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org