Commit c7295a27 authored by Matt Clarkson's avatar Matt Clarkson

Merge branch '4-cuda-on-windows'

parents 0162d462 89131e37
Pipeline #4157 passed with stages
in 22 minutes and 34 seconds
......@@ -107,6 +107,7 @@ windows build:
stage: build
tags:
# Should run on Widows 10, CUDA 10.1, MSVC 2017, in integration lab.
- shared-win-cuda
script:
......@@ -130,7 +131,7 @@ windows build:
- pip install numpy wheel six opencv-contrib-python pytest
- cmake -G "Visual Studio 15 2017 Win64"
-DCMAKE_BUILD_TYPE:STRING=Release
-DSKSURGERYGPUCPP_USE_CUDA:BOOL=OFF
-DSKSURGERYGPUCPP_USE_CUDA:BOOL=ON
-DSKSURGERYGPUCPP_CUDA_ARCH_BIN:STRING=61
--config "Release" ${Env:src_dir}
- if ($LastExitCode -ne 0) {throw $LastExitCode}
......
......@@ -14,8 +14,8 @@
#include <iostream>
#include "sksGPUUtils.h"
//#include "opencv2/core/cuda.hpp"
//#include "opencv2/cudaarithm.hpp"
#include "opencv2/core/cuda.hpp"
#include "opencv2/cudaarithm.hpp"
namespace sks
{
......@@ -23,8 +23,6 @@ namespace sks
//-----------------------------------------------------------------------------
cv::Mat MultiplyTwoArrays(const cv::Mat &a, const cv::Mat &b)
{
return a;
/*
cv::cuda::GpuMat mul, src_a, src_b;
src_a.upload(a);
src_b.upload(b);
......@@ -35,16 +33,12 @@ cv::Mat MultiplyTwoArrays(const cv::Mat &a, const cv::Mat &b)
mul.download(result_host);
return result_host;
*/
}
//-----------------------------------------------------------------------------
cv::Mat GpuThreshold(const cv::Mat &input)
{
return input;
/*
cv::cuda::GpuMat dst, src;
src.upload(input);
......@@ -54,15 +48,12 @@ cv::Mat GpuThreshold(const cv::Mat &input)
dst.download(result_host);
return result_host;
*/
}
//-----------------------------------------------------------------------------
void PrintCudaDeviceInfo()
{
return;
/*
int deviceCount = cv::cuda::getCudaEnabledDeviceCount();
if (deviceCount == 0)
{
......@@ -72,7 +63,6 @@ void PrintCudaDeviceInfo()
{
cv::cuda::printCudaDeviceInfo(0);
}
*/
}
} // namespace sks
\ No newline at end of file
......@@ -7,9 +7,8 @@ import pytest
def test_gpu_thershold():
img = cv2.imread('Testing/Data/thresholding/planes-input.png', cv2.IMREAD_GRAYSCALE)
assert True
#gpu_output = skgpu.gpu_threshold(img)
#gpu_output_uint8 = gpu_output.astype(np.uint8)
gpu_output = skgpu.gpu_threshold(img)
gpu_output_uint8 = gpu_output.astype(np.uint8)
#expected = cv2.imread('Testing/Data/thresholding/planes-thresholded.png', cv2.IMREAD_GRAYSCALE)
#assert np.array_equal(gpu_output_uint8, expected)
expected = cv2.imread('Testing/Data/thresholding/planes-thresholded.png', cv2.IMREAD_GRAYSCALE)
assert np.array_equal(gpu_output_uint8, expected)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment