Skip to content

Add trace for kernel launches #3143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 22, 2021
Merged

Conversation

umar456
Copy link
Member

@umar456 umar456 commented Jun 8, 2021

Add traces for kernel launches for OpenCL and CUDA. This will print kernel names for CUDA and OpenCL. It will print the launch configuration(blocks, threads) for CUDA

Description

  • Print the following trace for CUDA:
    [kernel][1623190555][731273] [ /data/devel/arrayfire/src/backend/cuda/kernel/random_engine.hpp:1064 ] Launching uniformPhilox: Blocks: [1] Threads: [256] Shared Memory: 0
  • Print the following trace for OpenCL
    [kernel][1623193966][746791] [ ../src/backend/opencl/Kernel.hpp:33 ] Launching philoxGenerator

Changes to Users

Users can filter these traces by setting the environment variable AF_TRACE to kernel

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

@umar456 umar456 requested a review from 9prady9 June 8, 2021 23:14
Copy link
Member

@9prady9 9prady9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

although i dislike std::string usage after i became aware of the issues it can potentially cause. we already kind of use it in many locations though.

@@ -338,6 +338,7 @@ if(UNIX)
if(CUDA_VERSION VERSION_GREATER 10.0)
target_link_libraries(af_cuda_static_cuda_library
PRIVATE
spdlog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is added in common interface target, dont we use common interface target with this static lib ?

. also it will fail when we looj for system/vcpkg provided spdlog target spdlog::spdlog_header_only -- perhaps I can handle this in my PR #3139

@umar456 umar456 merged commit 9267ee7 into arrayfire:master Jun 22, 2021
@umar456 umar456 deleted the launch_trace branch June 22, 2021 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants