compute_device_list is using static vector of device information which had pointers (identifier and name) to values from device information structures. That structures are also stored in static vector and being refreshed every 5 seconds. The issue is, as soon as device information is being updated, pointers in vector from compute_device_list became incorrect. Seems it was the reason of issues with sudden switching from CUDA to OpenCL on my desktop and from CUDA to CPU on my laptop, It was also seems to be making persistent images behaves instable. Made it so device identifier and name are copied from device info to structures used by RNA (CCLDeviceInfo). Alternative could be avoid cacheing CCLDeviceInfo and always use actual list of device information by RNA. It shouldn't be so much slow.
47 lines
1.2 KiB
C
47 lines
1.2 KiB
C
/*
|
|
* Copyright 2011, Blender Foundation.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
#ifndef CCL_API_H
|
|
#define CCL_API_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* returns a list of devices for selection, array is empty identifier
|
|
* terminated and must not be freed */
|
|
|
|
typedef struct CCLDeviceInfo {
|
|
char identifier[128];
|
|
char name[512];
|
|
int value;
|
|
} CCLDeviceInfo;
|
|
|
|
CCLDeviceInfo *CCL_compute_device_list(int opencl);
|
|
|
|
/* create python module _cycles used by addon */
|
|
|
|
void *CCL_python_module_init(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CCL_API_H */
|
|
|