Skip to content

Commit c65a19b

Browse files
committed
cudasift - added cl args for HIP and SYCL
1 parent 86c0d2c commit c65a19b

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

cudaSift/HIP/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ include_directories(${OpenCV_INCLUDE_DIRS})
5757

5858
set(SOURCES
5959
${CMAKE_SOURCE_DIR}/../common/Utility.cpp
60+
${CMAKE_SOURCE_DIR}/../common/workload_params.cpp
61+
${CMAKE_SOURCE_DIR}/../../infrastructure/CommandLineParser.cpp
62+
${CMAKE_SOURCE_DIR}/../../infrastructure/TestBenchBase.cpp
63+
${CMAKE_SOURCE_DIR}/../../infrastructure/Utilities.cpp
6064
cudaImage.cpp
6165
cudaImage.h
6266
cudaSiftH.cpp
@@ -71,6 +75,7 @@ set(SOURCES
7175

7276
include_directories(
7377
${CMAKE_SOURCE_DIR}/../common/
78+
${CMAKE_SOURCE_DIR}/../../infrastructure
7479
${CMAKE_CURRENT_SOURCE_DIR}
7580
${HIP_INCLUDE_DIRS}
7681
)

cudaSift/HIP/mainSift.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
#include "Utility.h"
3939
#include "cudaImage.h"
4040
#include "cudaSift.h"
41+
#include "../common/workload_params.h"
42+
#include "Utilities.h"
43+
#include "CommandLineParser.h"
4144

4245
int ImproveHomography(SiftData &data, float *homography, int numLoops, float minScore, float maxAmbiguity, float thresh);
4346
void PrintMatchData(SiftData &siftData1, SiftData &siftData2, CudaImage &img);
@@ -48,7 +51,7 @@ double ScaleUp(CudaImage &res, CudaImage &src);
4851
///////////////////////////////////////////////////////////////////////////////
4952
// Main program
5053
///////////////////////////////////////////////////////////////////////////////
51-
int main(int argc, char **argv)
54+
int main(int argc, const char **argv)
5255
{
5356
auto totalProgTimer_start = std::chrono::steady_clock::now();
5457
int devNum = 0, imgSet = 0;
@@ -57,6 +60,9 @@ int main(int argc, char **argv)
5760
if (argc > 2)
5861
imgSet = std::atoi(argv[2]);
5962

63+
common::WorkloadParams workload_params(argc, argv);
64+
std::string inputDataLoc = workload_params.getInputDataLoc();
65+
6066
float totTime = 0.0;
6167
float imageInitTime = 0.0;
6268
float extractSiftTime = 0.0;
@@ -78,13 +84,13 @@ int main(int argc, char **argv)
7884
std::string inp_file_1, inp_file_2;
7985
if (imgSet)
8086
{
81-
inp_file_1 = "../../inputData/left.pgm";
82-
inp_file_2 = "../../inputData/righ.pgm";
87+
inp_file_1 = inputDataLoc + "/left.pgm";
88+
inp_file_2 = inputDataLoc + "/righ.pgm";
8389
}
8490
else
8591
{
86-
inp_file_1 = "../../inputData/img1.png";
87-
inp_file_2 = "../../inputData/img2.png";
92+
inp_file_1 = inputDataLoc + "/img1.png";
93+
inp_file_2 = inputDataLoc + "/img2.png";
8894
}
8995

9096
if (!std::filesystem::exists(inp_file_1))

cudaSift/SYCL/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ endif()
5555

5656
set(SOURCES
5757
${CMAKE_SOURCE_DIR}/../common/Utility.cpp
58+
${CMAKE_SOURCE_DIR}/../common/workload_params.cpp
59+
${CMAKE_SOURCE_DIR}/../../infrastructure/CommandLineParser.cpp
60+
${CMAKE_SOURCE_DIR}/../../infrastructure/TestBenchBase.cpp
61+
${CMAKE_SOURCE_DIR}/../../infrastructure/Utilities.cpp
5862
cudaImage.dp.cpp
5963
cudaImage.h
6064
cudaSiftH.dp.cpp
@@ -68,6 +72,7 @@ set(SOURCES
6872

6973
include_directories(
7074
${CMAKE_SOURCE_DIR}/../common/
75+
${CMAKE_SOURCE_DIR}/../../infrastructure
7176
${CMAKE_SOURCE_DIR}
7277
${OpenCV_INCLUDE_DIRS}
7378
)

cudaSift/SYCL/mainSift.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
#include "cudaSift.h"
3939
#include "infra/infra.hpp"
4040
#include "Utility.h"
41+
#include "../common/workload_params.h"
42+
#include "Utilities.h"
43+
#include "CommandLineParser.h"
4144

4245
#ifndef KERNEL_USE_PROFILE
4346
#define KERNEL_USE_PROFILE 0
@@ -53,7 +56,7 @@ double ScaleUp(CudaImage &res, CudaImage &src);
5356
///////////////////////////////////////////////////////////////////////////////
5457
// Main program
5558
///////////////////////////////////////////////////////////////////////////////
56-
int main(int argc, char **argv)
59+
int main(int argc, const char **argv)
5760
{
5861
auto totalProgTimer_start = std::chrono::steady_clock::now();
5962
int devNum = 0, imgSet = 0;
@@ -62,6 +65,9 @@ int main(int argc, char **argv)
6265
if (argc > 2)
6366
imgSet = std::atoi(argv[2]);
6467

68+
common::WorkloadParams workload_params(argc, argv);
69+
std::string inputDataLoc = workload_params.getInputDataLoc();
70+
6571
float totTime = 0.0;
6672
float imageInitTime = 0.0;
6773
float extractSiftTime = 0.0;
@@ -91,13 +97,13 @@ int main(int argc, char **argv)
9197
std::string inp_file_1, inp_file_2;
9298
if (imgSet)
9399
{
94-
inp_file_1 = "../../inputData/left.pgm";
95-
inp_file_2 = "../../inputData/righ.pgm";
100+
inp_file_1 = inputDataLoc + "/left.pgm";
101+
inp_file_2 = inputDataLoc + "/righ.pgm";
96102
}
97103
else
98104
{
99-
inp_file_1 = "../../inputData/img1.png";
100-
inp_file_2 = "../../inputData/img2.png";
105+
inp_file_1 = inputDataLoc + "/img1.png";
106+
inp_file_2 = inputDataLoc + "/img2.png";
101107
}
102108

103109
if (!std::filesystem::exists(inp_file_1))

0 commit comments

Comments
 (0)