Skip to content

Commit

Permalink
Update kp_sampler_skip.cpp: \n instead of std::endl
Browse files Browse the repository at this point in the history
\n is faster for performance
  • Loading branch information
vlkale authored Apr 2, 2024
1 parent 51c2094 commit e1aacb0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions common/kokkos-sampler/kp_sampler_skip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void kokkosp_begin_parallel_for(const char* name, const uint32_t devID,
if ((invocationNum % kernelSampleSkip) == 0) {
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << *kID
<< " calling child-begin function..." << std::endl;
<< " calling child-begin function...\n";
}
if (tool_globFence) {
invoke_ktools_fence(0);
Expand All @@ -207,7 +207,7 @@ void kokkosp_begin_parallel_for(const char* name, const uint32_t devID,
(*beginForCallee)(name, devID, &nestedkID);
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << *kID
<< " called child-begin function." << std::endl;
<< " finished with child-begin function.\n";
}
infokIDSample.insert({*kID, nestedkID});
}
Expand All @@ -220,7 +220,7 @@ void kokkosp_end_parallel_for(const uint64_t kID) {
uint64_t retrievedNestedkID = infokIDSample[kID];
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << kID
<< " calling child-end function..." << std::endl;
<< " calling child-end function...\n";
}

if (tool_globFence) {
Expand All @@ -229,7 +229,7 @@ void kokkosp_end_parallel_for(const uint64_t kID) {
(*endForCallee)(retrievedNestedkID);
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << kID
<< " called child-end function." << std::endl;
<< " finished with child-end function.\n";
}
infokIDSample.erase(kID);
}
Expand All @@ -244,7 +244,7 @@ void kokkosp_begin_parallel_scan(const char* name, const uint32_t devID,
if ((invocationNum % kernelSampleSkip) == 0) {
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << *kID
<< " calling child-begin function..." << std::endl;
<< " calling child-begin function...\n";
}
if (NULL != beginScanCallee) {
uint64_t nestedkID = 0;
Expand All @@ -254,7 +254,7 @@ void kokkosp_begin_parallel_scan(const char* name, const uint32_t devID,
(*beginScanCallee)(name, devID, &nestedkID);
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << *kID
<< " called child-begin function." << std::endl;
<< " finished with child-begin function.\n";
}
infokIDSample.insert({*kID, nestedkID});
}
Expand All @@ -267,15 +267,15 @@ void kokkosp_end_parallel_scan(const uint64_t kID) {
uint64_t retrievedNestedkID = infokIDSample[kID];
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << kID
<< " calling child-end function..." << std::endl;
<< " calling child-end function...\n";
}
if (tool_globFence) {
invoke_ktools_fence(0);
}
(*endScanCallee)(retrievedNestedkID);
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << kID
<< " called child-end function." << std::endl;
<< " finished with child-end function.\n";
}
infokIDSample.erase(kID);
}
Expand All @@ -290,7 +290,7 @@ void kokkosp_begin_parallel_reduce(const char* name, const uint32_t devID,
if ((invocationNum % kernelSampleSkip) == 0) {
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << *kID
<< " calling child-begin function..." << std::endl;
<< " calling child-begin function...\n";
}
if (NULL != beginReduceCallee) {
uint64_t nestedkID = 0;
Expand All @@ -300,7 +300,7 @@ void kokkosp_begin_parallel_reduce(const char* name, const uint32_t devID,
(*beginReduceCallee)(name, devID, &nestedkID);
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << *kID
<< " called child-begin function." << std::endl;
<< " finished with child-begin function.\n";
}
infokIDSample.insert({*kID, nestedkID});
}
Expand All @@ -313,15 +313,15 @@ void kokkosp_end_parallel_reduce(const uint64_t kID) {
uint64_t retrievedNestedkID = infokIDSample[kID];
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << kID
<< " calling child-end function..." << std::endl;
<< " calling child-end function...\n";
}
if (tool_globFence) {
invoke_ktools_fence(0);
}
(*endReduceCallee)(retrievedNestedkID);
if (tool_verbosity > 0) {
std::cout << "KokkosP: sample " << kID
<< " called child-end function." << std::endl;
<< " finished with child-end function.\n";
}
infokIDSample.erase(kID);
}
Expand Down

0 comments on commit e1aacb0

Please sign in to comment.