Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
6da2573b
Commit
6da2573b
authored
Aug 02, 2010
by
Andrey Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fix
parent
8c77e5fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
25 deletions
+5
-25
matrix_operations.cu
modules/gpu/src/cuda/matrix_operations.cu
+5
-25
No files found.
modules/gpu/src/cuda/matrix_operations.cu
View file @
6da2573b
...
...
@@ -52,7 +52,7 @@ using namespace cv::gpu::impl;
namespace mat_operators
{
__constant__ double scalar_d[
256
];
__constant__ double scalar_d[
4
];
template <typename T>
...
...
@@ -139,7 +139,7 @@ namespace mat_operators
if ((x < cols * channels ) && (y < rows))
{
size_t idx = y * ( step >> shift_and_sizeof<T>::shift ) + x;
mat[idx] = scalar_d[
threadIdx.x
];
mat[idx] = scalar_d[
x % channels
];
}
}
...
...
@@ -153,7 +153,7 @@ namespace mat_operators
if (mask[y * step_mask + x / channels] != 0)
{
size_t idx = y * ( step >> shift_and_sizeof<T>::shift ) + x;
mat[idx] = scalar_d[
threadIdx.x
];
mat[idx] = scalar_d[
x % channels
];
}
}
...
...
@@ -354,17 +354,7 @@ namespace cv
extern "C" void set_to_without_mask(DevMem2D mat, int depth, const double *scalar, int channels, const cudaStream_t & stream)
{
double * scalar_vec = new double [256];
int index = 0;
for (int i = 0; i < 256; i++)
{
scalar_vec[i] = scalar[index];
index++;
if (index == channels) index = 0;
}
cudaSafeCall( cudaMemcpyToSymbol(mat_operators::scalar_d, scalar_vec, sizeof(double) * 256));
delete [] scalar_vec;
cudaSafeCall( cudaMemcpyToSymbol(mat_operators::scalar_d, scalar, sizeof(double) * 4));
static SetToFunc_without_mask tab[8] =
{
...
...
@@ -389,17 +379,7 @@ namespace cv
extern "C" void set_to_with_mask(DevMem2D mat, int depth, const double * scalar, const DevMem2D& mask, int channels, const cudaStream_t & stream)
{
double * scalar_vec = new double [256];
int index = 0;
for (int i = 0; i < 256; i++)
{
scalar_vec[i] = scalar[index];
index++;
if (index == channels) index = 0;
}
cudaSafeCall( cudaMemcpyToSymbol(mat_operators::scalar_d, scalar_vec, sizeof(double) * 256));
delete [] scalar_vec;
cudaSafeCall( cudaMemcpyToSymbol(mat_operators::scalar_d, scalar, sizeof(double) * 4));
static SetToFunc_with_mask tab[8] =
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment