Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f91c0097
Commit
f91c0097
authored
Nov 23, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opencl: Don't call callback functions from the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f153ca0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
79 deletions
+3
-79
unix_wrappers.c
dlls/opencl/unix_wrappers.c
+3
-79
No files found.
dlls/opencl/unix_wrappers.c
View file @
f91c0097
...
...
@@ -26,80 +26,21 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
opencl
);
struct
program_callback
{
void
(
WINAPI
*
pfn_notify
)(
cl_program
program
,
void
*
user_data
);
void
*
user_data
;
};
static
void
CL_CALLBACK
program_callback_wrapper
(
cl_program
program
,
void
*
user_data
)
{
struct
program_callback
*
callback
=
user_data
;
TRACE
(
"(%p, %p)
\n
"
,
program
,
user_data
);
callback
->
pfn_notify
(
program
,
callback
->
user_data
);
free
(
callback
);
}
cl_int
WINAPI
wrap_clBuildProgram
(
cl_program
program
,
cl_uint
num_devices
,
const
cl_device_id
*
device_list
,
const
char
*
options
,
void
(
WINAPI
*
pfn_notify
)(
cl_program
program
,
void
*
user_data
),
void
*
user_data
)
{
if
(
pfn_notify
)
{
struct
program_callback
*
callback
;
cl_int
ret
;
if
(
!
(
callback
=
malloc
(
sizeof
(
*
callback
))))
return
CL_OUT_OF_HOST_MEMORY
;
callback
->
pfn_notify
=
pfn_notify
;
callback
->
user_data
=
user_data
;
if
((
ret
=
clBuildProgram
(
program
,
num_devices
,
device_list
,
options
,
program_callback_wrapper
,
callback
))
!=
CL_SUCCESS
)
free
(
callback
);
return
ret
;
}
if
(
pfn_notify
)
FIXME
(
"notify callback not supported
\n
"
);
return
clBuildProgram
(
program
,
num_devices
,
device_list
,
options
,
NULL
,
NULL
);
}
struct
context_callback
{
void
(
WINAPI
*
pfn_notify
)(
const
char
*
errinfo
,
const
void
*
private_info
,
size_t
cb
,
void
*
user_data
);
void
*
user_data
;
};
static
void
CL_CALLBACK
context_callback_wrapper
(
const
char
*
errinfo
,
const
void
*
private_info
,
size_t
cb
,
void
*
user_data
)
{
struct
context_callback
*
callback
=
user_data
;
TRACE
(
"(%s, %p, %zu, %p)
\n
"
,
debugstr_a
(
errinfo
),
private_info
,
cb
,
user_data
);
callback
->
pfn_notify
(
errinfo
,
private_info
,
cb
,
callback
->
user_data
);
}
cl_context
WINAPI
wrap_clCreateContext
(
const
cl_context_properties
*
properties
,
cl_uint
num_devices
,
const
cl_device_id
*
devices
,
void
(
WINAPI
*
pfn_notify
)(
const
char
*
errinfo
,
const
void
*
private_info
,
size_t
cb
,
void
*
user_data
),
void
*
user_data
,
cl_int
*
errcode_ret
)
{
if
(
pfn_notify
)
{
struct
context_callback
*
callback
;
cl_context
ret
;
/* FIXME: the callback structure is currently leaked */
if
(
!
(
callback
=
malloc
(
sizeof
(
*
callback
))))
{
*
errcode_ret
=
CL_OUT_OF_HOST_MEMORY
;
return
NULL
;
}
callback
->
pfn_notify
=
pfn_notify
;
callback
->
user_data
=
user_data
;
if
(
!
(
ret
=
clCreateContext
(
properties
,
num_devices
,
devices
,
context_callback_wrapper
,
callback
,
errcode_ret
)))
free
(
callback
);
return
ret
;
}
if
(
pfn_notify
)
FIXME
(
"notify callback not supported
\n
"
);
return
clCreateContext
(
properties
,
num_devices
,
devices
,
NULL
,
NULL
,
errcode_ret
);
}
...
...
@@ -107,24 +48,7 @@ cl_context WINAPI wrap_clCreateContextFromType( const cl_context_properties *pro
void
(
WINAPI
*
pfn_notify
)(
const
char
*
errinfo
,
const
void
*
private_info
,
size_t
cb
,
void
*
user_data
),
void
*
user_data
,
cl_int
*
errcode_ret
)
{
if
(
pfn_notify
)
{
struct
context_callback
*
callback
;
cl_context
ret
;
/* FIXME: the callback structure is currently leaked */
if
(
!
(
callback
=
malloc
(
sizeof
(
*
callback
))))
{
*
errcode_ret
=
CL_OUT_OF_HOST_MEMORY
;
return
NULL
;
}
callback
->
pfn_notify
=
pfn_notify
;
callback
->
user_data
=
user_data
;
if
(
!
(
ret
=
clCreateContextFromType
(
properties
,
device_type
,
context_callback_wrapper
,
callback
,
errcode_ret
)))
free
(
callback
);
return
ret
;
}
if
(
pfn_notify
)
FIXME
(
"notify callback not supported
\n
"
);
return
clCreateContextFromType
(
properties
,
device_type
,
NULL
,
NULL
,
errcode_ret
);
}
...
...
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