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
0d3e2046
Unverified
Commit
0d3e2046
authored
Apr 19, 2020
by
Ilya Matiach
Committed by
GitHub
Apr 19, 2020
Browse files
[SWIG][mmlspark] allow allocating more than int max array (#2859)
parent
995a5974
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
swig/lightgbmlib.i
swig/lightgbmlib.i
+30
-5
No files found.
swig/lightgbmlib.i
View file @
0d3e2046
...
...
@@ -233,11 +233,6 @@
%
pointer_cast
(
int32_t
*
,
void
*
,
int32_t_to_voidp_ptr
)
%
pointer_cast
(
int64_t
*
,
void
*
,
int64_t_to_voidp_ptr
)
%
array_functions
(
double
,
doubleArray
)
%
array_functions
(
float
,
floatArray
)
%
array_functions
(
int
,
intArray
)
%
array_functions
(
long
,
longArray
)
/* Custom pointer manipulation template */
%
define
%
pointer_manipulation
(
TYPE
,
NAME
)
%
{
...
...
@@ -278,6 +273,36 @@ TYPE *NAME##_handle();
%
enddef
%
define
%
long_array_functions
(
TYPE
,
NAME
)
%
{
static
TYPE
*
new_
##
NAME
(
int64_t
nelements
)
{
%
}
%
{
return
new
TYPE
[
nelements
]()
;
%
}
%
{}
static
void
delete_
##
NAME
(
TYPE
*
ary
)
{
%
}
%
{
delete
[]
ary
;
%
}
%
{}
static
TYPE
NAME
##
_getitem
(
TYPE
*
ary
,
int64_t
index
)
{
return
ary
[
index
]
;
}
static
void
NAME
##
_setitem
(
TYPE
*
ary
,
int64_t
index
,
TYPE
value
)
{
ary
[
index
]
=
value
;
}
%
}
TYPE
*
new_
##
NAME
(
int64_t
nelements
)
;
void
delete_
##
NAME
(
TYPE
*
ary
)
;
TYPE
NAME
##
_getitem
(
TYPE
*
ary
,
int64_t
index
)
;
void
NAME
##
_setitem
(
TYPE
*
ary
,
int64_t
index
,
TYPE
value
)
;
%
enddef
%
long_array_functions
(
double
,
doubleArray
)
%
long_array_functions
(
float
,
floatArray
)
%
long_array_functions
(
int
,
intArray
)
%
long_array_functions
(
long
,
longArray
)
%
pointer_manipulation
(
void
*
,
voidpp
)
/* Allow dereferencing of void** to void* */
...
...
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