Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gsll
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antonio Juan
gsll
Commits
ebd23bf3
Commit
ebd23bf3
authored
14 years ago
by
Liam M. Healy
Browse files
Options
Downloads
Patches
Plain Diff
Pass 'finalize argument from make-foreign-array-from-mpointer to grid:make-grid
parent
42dfd182
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/foreign-array.lisp
+5
-3
5 additions, 3 deletions
data/foreign-array.lisp
init/funcallable.lisp
+3
-2
3 additions, 2 deletions
init/funcallable.lisp
with
8 additions
and
5 deletions
data/foreign-array.lisp
+
5
−
3
View file @
ebd23bf3
;; A grid:foreign-array with added metadata for GSL.
;; A grid:foreign-array with added metadata for GSL.
;; Liam Healy 2008-04-06 21:23:41EDT
;; Liam Healy 2008-04-06 21:23:41EDT
;; Time-stamp: <2010-07-13 1
0:24
:4
3
EDT foreign-array.lisp>
;; Time-stamp: <2010-07-13 1
2:06
:4
5
EDT foreign-array.lisp>
;;
;;
;; Copyright 2008, 2009, 2010 Liam M. Healy
;; Copyright 2008, 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;; Distributed under the terms of the GNU General Public License
...
@@ -75,7 +75,8 @@
...
@@ -75,7 +75,8 @@
;; foreign-array.
;; foreign-array.
(
defun
make-foreign-array-from-mpointer
(
defun
make-foreign-array-from-mpointer
(
mpointer
&optional
(
element-type
'double-float
)
(
category
:vector
))
(
mpointer
&optional
(
element-type
'double-float
)
(
category
:vector
)
finalize
)
"Make the foreign array when a GSL pointer to a
"Make the foreign array when a GSL pointer to a
gsl-vector-c or gsl-matrix-c is given."
gsl-vector-c or gsl-matrix-c is given."
(
let*
((
cstruct
(
let*
((
cstruct
...
@@ -95,6 +96,7 @@
...
@@ -95,6 +96,7 @@
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size1
))
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size1
))
,
element-type
)))
,
element-type
)))
:foreign-pointer
:foreign-pointer
(
cffi:foreign-slot-value
mpointer
cstruct
'data
))))
(
cffi:foreign-slot-value
mpointer
cstruct
'data
)
:finalizer
finalize
)))
(
setf
(
grid:metadata-slot
fa
'mpointer
)
mpointer
)
(
setf
(
grid:metadata-slot
fa
'mpointer
)
mpointer
)
fa
))
fa
))
This diff is collapsed.
Click to expand it.
init/funcallable.lisp
+
3
−
2
View file @
ebd23bf3
;; Generate a lambda that calls the user function; will be called by callback.
;; Generate a lambda that calls the user function; will be called by callback.
;; Liam Healy
;; Liam Healy
;; Time-stamp: <2010-07-13 1
0:37:28
EDT funcallable.lisp>
;; Time-stamp: <2010-07-13 1
2:06:01
EDT funcallable.lisp>
;;
;;
;; Copyright 2009, 2010 Liam M. Healy
;; Copyright 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;; Distributed under the terms of the GNU General Public License
...
@@ -68,7 +68,8 @@
...
@@ -68,7 +68,8 @@
`
(
make-foreign-array-from-mpointer
`
(
make-foreign-array-from-mpointer
,
ptr
,
ptr
',
(
grid:cffi-cl
(
parse-callback-argspec
argspec
'element-type
))
',
(
grid:cffi-cl
(
parse-callback-argspec
argspec
'element-type
))
,
(
length
(
parse-callback-argspec
argspec
'dimensions
))))
,
(
length
(
parse-callback-argspec
argspec
'dimensions
))
t
))
(
:cvector
; a raw C vector
(
:cvector
; a raw C vector
`
(
grid:make-foreign-array-from-pointer
`
(
grid:make-foreign-array-from-pointer
,
ptr
,
ptr
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment