Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
dfbb8836
Unverified
Commit
dfbb8836
authored
Jun 13, 2018
by
Guolin Ke
Committed by
GitHub
Jun 13, 2018
Browse files
remove a omp critical region
parent
befaa1bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
src/io/dense_nbits_bin.hpp
src/io/dense_nbits_bin.hpp
+1
-9
No files found.
src/io/dense_nbits_bin.hpp
View file @
dfbb8836
...
...
@@ -41,6 +41,7 @@ public:
:
num_data_
(
num_data
)
{
int
len
=
(
num_data_
+
1
)
/
2
;
data_
=
std
::
vector
<
uint8_t
>
(
len
,
static_cast
<
uint8_t
>
(
0
));
buf_
=
std
::
vector
<
uint8_t
>
(
len
,
static_cast
<
uint8_t
>
(
0
));
}
~
Dense4bitsBin
()
{
...
...
@@ -48,15 +49,6 @@ public:
}
void
Push
(
int
,
data_size_t
idx
,
uint32_t
value
)
override
{
if
(
buf_
.
empty
())
{
#pragma omp critical
{
if
(
buf_
.
empty
())
{
int
len
=
(
num_data_
+
1
)
/
2
;
buf_
=
std
::
vector
<
uint8_t
>
(
len
,
static_cast
<
uint8_t
>
(
0
));
}
}
}
const
int
i1
=
idx
>>
1
;
const
int
i2
=
(
idx
&
1
)
<<
2
;
const
uint8_t
val
=
static_cast
<
uint8_t
>
(
value
)
<<
i2
;
...
...
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