Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
5ecd904d
Commit
5ecd904d
authored
Jul 22, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
cf321559
fd6db821
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
11 deletions
+22
-11
cmake_mex_wrapper
dlib/matlab/cmake_mex_wrapper
+1
-1
mex_wrapper.cpp
dlib/matlab/mex_wrapper.cpp
+0
-0
subprocess_stream.cpp
dlib/matlab/subprocess_stream.cpp
+13
-2
matrix.h
dlib/matrix/matrix.h
+8
-8
matrix_data_layout.h
dlib/matrix/matrix_data_layout.h
+0
-0
No files found.
dlib/matlab/cmake_mex_wrapper
View file @
5ecd904d
...
...
@@ -54,7 +54,7 @@ INCLUDE_DIRECTORIES("${dlib_matlab_binding_path}")
# Also add dlib to the include search path
INCLUDE_DIRECTORIES(${dlib_matlab_binding_path}/../..)
include(${dlib_matlab_binding_path}/../add_global_compiler_switch.cmake)
include(${dlib_matlab_binding_path}/../
cmake_utils/
add_global_compiler_switch.cmake)
add_global_define(MATLAB_MEX_FILE)
# Determine the path to our CMakeLists.txt file. This is the file that
...
...
dlib/matlab/mex_wrapper.cpp
View file @
5ecd904d
This diff is collapsed.
Click to expand it.
dlib/matlab/subprocess_stream.cpp
View file @
5ecd904d
...
...
@@ -434,9 +434,20 @@ namespace dlib
stderr_pipe
.
close
();
char
*
argv
[]
=
{(
char
*
)
program_name
,
nullptr
};
char
*
envp
[]
=
{
nullptr
};
char
*
cudadevs
=
getenv
(
"CUDA_VISIBLE_DEVICES"
);
if
(
cudadevs
)
{
std
::
string
extra
=
std
::
string
(
"CUDA_VISIBLE_DEVICES="
)
+
cudadevs
;
char
*
envp
[]
=
{(
char
*
)
extra
.
c_str
(),
nullptr
};
execve
(
argv
[
0
],
argv
,
envp
);
}
else
{
char
*
envp
[]
=
{
nullptr
};
execve
(
argv
[
0
],
argv
,
envp
);
}
execve
(
argv
[
0
],
argv
,
envp
);
// If launching the child didn't work then bail immediately so the parent
// process has no chance to get tweaked out (*cough* MATLAB *cough*).
_Exit
(
1
);
...
...
dlib/matrix/matrix.h
View file @
5ecd904d
...
...
@@ -1174,8 +1174,8 @@ namespace dlib
{
#ifdef MATLAB_MEX_FILE
// You can't move memory around when compiled in a matlab mex file and the
// different locations have different
persistence
settings.
if
(
data
.
_private_is_
persistent
()
==
item
.
data
.
_private_is_persistent
())
// different locations have different
ownership
settings.
if
(
data
.
_private_is_
owned_by_matlab
()
==
item
.
data
.
_private_is_owned_by_matlab
())
{
swap
(
item
);
}
...
...
@@ -1195,8 +1195,8 @@ namespace dlib
{
#ifdef MATLAB_MEX_FILE
// You can't move memory around when compiled in a matlab mex file and the
// different locations have different
persistence
settings.
if
(
data
.
_private_is_
persistent
()
==
rhs
.
data
.
_private_is_persistent
())
// different locations have different
ownership
settings.
if
(
data
.
_private_is_
owned_by_matlab
()
==
rhs
.
data
.
_private_is_owned_by_matlab
())
{
swap
(
rhs
);
}
...
...
@@ -1343,14 +1343,14 @@ namespace dlib
return
data
.
_private_release_mxArray
();
}
void
_private_mark_
non_persistent
()
void
_private_mark_
owned_by_matlab
()
{
data
.
_private_mark_
non_persistent
();
data
.
_private_mark_
owned_by_matlab
();
}
bool
_private_is_
persistent
()
bool
_private_is_
owned_by_matlab
()
{
return
data
.
_private_is_
persistent
();
return
data
.
_private_is_
owned_by_matlab
();
}
#endif
...
...
dlib/matrix/matrix_data_layout.h
View file @
5ecd904d
This diff is collapsed.
Click to expand it.
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