Skip to content

Add trace for kernel launches - #3143

Merged
umar456 merged 2 commits into
arrayfire:masterfrom
umar456:launch_trace
Jun 22, 2021
Merged

umar456 merged 2 commits into
arrayfire:masterfrom
umar456:launch_trace

Conversation

@umar456

@umar456 umar456 commented Jun 8, 2021

Copy link
Copy Markdown
Member

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

@9prady9 9prady9 left a comment

Copy link
Copy Markdown
Member

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.

if(CUDA_VERSION VERSION_GREATER 10.0)
target_link_libraries(af_cuda_static_cuda_library
PRIVATE
spdlog

Copy link
Copy Markdown
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

Comment thread src/backend/cuda/jit.cpp Resolved
@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