Skip to content

Commit

Permalink
Merge pull request #18 from dachang/2020.2
Browse files Browse the repository at this point in the history
2020.2

Former-commit-id: e47f9ae24ca481aa54eca0cad46d6f4d34ba3e6e [formerly 2eb1613]
Former-commit-id: 2bc5f73697b5e2bfb44648617c058b9f1765e63d
  • Loading branch information
Dachang Li authored and GitHub Enterprise committed Nov 22, 2020
2 parents f03a26c + ecd626c commit 8f77064
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ clWaitForEvents(1, (const cl_event *)&event_sp);
cl_ulong start = 0;
cl_ulong end = 0;
double diff_prof = 0.0f;
event_sp.getProfilingInfo(CL_PROFILING_COMMAND_START, &start);
event_sp.getProfilingInfo(CL_PROFILING_COMMAND_END, &end);
diff_prof = end - start;
// event_sp.getProfilingInfo(CL_PROFILING_COMMAND_START, &start);
// event_sp.getProfilingInfo(CL_PROFILING_COMMAND_END, &end);
// diff_prof = end - start;
std::cout << "Latency: " << (diff_prof / 1000000) << "ms" << std::endl;

q.enqueueReadBuffer(resizeFromDevice, CL_TRUE, 0, resize_size, out_buf_0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ std::vector<cv::Mat> DecodeThread::v4l2Mats(2);
auto image_from_device_start = std::chrono::system_clock::now();
v4l2_videoCapture(v4l2Mats);
while (!queue_->push(FrameInfo{channel_id_, ++frame_id_, v4l2Mats[1], v4l2Mats[0]},
std::chrono::milliseconds(500))) {
std::chrono::milliseconds(10000))) {
if (is_stopped()) {
return -1;
}}


LOG(INFO)<<"Decode and Resize :"<<std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - image_from_device_start).count()/1000;
std::chrono::system_clock::now() - image_from_device_start).count()/1000<<"ms";
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace vitis {
}

int DpuThread::run() {
auto dpu_start = std::chrono::system_clock::now();
FrameInfo frame;
if (!queue_in_->pop(frame, std::chrono::milliseconds(500))) {
return 0;
Expand All @@ -52,6 +53,8 @@ namespace vitis {
return -1;
}
}
LOG(INFO)<<"DPU in single thread duration :"<<std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - dpu_start).count()/1000<<"ms";
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void GuiThread::clean_up_queue() {
}
}
int GuiThread::run() {
auto gui_start = std::chrono::system_clock::now();
FrameInfo frame_info;
if (!queue_->pop(frame_info, std::chrono::milliseconds(500))) {
inactive_counter_++;
Expand Down Expand Up @@ -129,6 +130,9 @@ int GuiThread::run() {
}
}
#endif
LOG(INFO)<<"Gui duration :"<<std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now() - gui_start).count()/1000<<"ms";

GuiThread::clean_up_queue();
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ namespace vitis{
long duration = 0;
if (!points_.empty()) {
auto end = points_.back();
duration =
duration =
std::chrono::duration_cast<std::chrono::milliseconds>(now - end)
.count();
LOG(INFO)<<"Sort thread duration : "<<duration<< " ms";
float duration2 = (float)duration;
float total = (float)points_.size();
fps = total / duration2 * 1000.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,35 @@
#

#!/bin/bash
set -e
BOARD_IP=10.176.18.178

git pull
rm -rf build
mkdir build&&cd build
cmake -DUSE_DRM=on -DUSE_KERNEL=on .. && make
cp *drm ../
build_command(){
cmake -DUSE_DRM=on .. && make
cp *drm ../

}

clean_workspace(){
if [ -d build ]; then
rm -rf build
fi
mkdir -pv build
cd build

}
copy_file()
{
scp usb_input* root@$BOARD_IP:/home/root/
scp HLS_*/lib* root@$BOARD_IP:/usr/lib
scp HLS_*/test_hls_kernel root@$BOARD_IP:/home/root/
}

main(){
clean_workspace
git pull
build_command
copy_file
}

main @$
49 changes: 49 additions & 0 deletions Machine_Learning/Introduction/03-Basic/Module_7/build_app_hls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Copyright 2020 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#!/bin/bash
set -e
BOARD_IP=10.176.18.178

build_command(){
cmake -DUSE_DRM=on -DUSE_KERNEL=on .. && make
cp *drm ../

}

clean_workspace(){
if [ -d build ]; then
rm -rf build
fi
mkdir -pv build
cd build

}
copy_file()
{
scp usb_input* root@$BOARD_IP:/home/root/
scp HLS_*/lib* root@$BOARD_IP:/usr/lib
scp HLS_*/test_hls_kernel root@$BOARD_IP:/home/root/
}

main(){
clean_workspace
git pull
build_command
copy_file
}

main @$
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

id=1:DPUCZDX8G_1.aclk
id=6:DPUCZDX8G_1.ap_clk_2
#id=1:DPUCZDX8G_2.aclk
#id=6:DPUCZDX8G_2.ap_clk_2
id=1:DPUCZDX8G_2.aclk
id=6:DPUCZDX8G_2.ap_clk_2
#id=1:DPUCZDX8G_3.aclk
#id=6:DPUCZDX8G_3.ap_clk_2
#id=1:sfm_xrt_top_1.aclk
Expand All @@ -43,7 +43,7 @@ nk=DPUCZDX8G:1
misc=:solution_name=link

#param=compiler.addOutputTypes=sd_card
#param=compiler.skipTimingCheckAndFrequencyScaling=1
param=compiler.skipTimingCheckAndFrequencyScaling=1

[vivado]
prop=run.impl_1.strategy=Performance_ExploreWithRemap
Expand Down

0 comments on commit 8f77064

Please sign in to comment.