Skip to main content
Known Participant
April 16, 2023
Answered

How to use scripts to determine whether opencl can be used

  • April 16, 2023
  • 2 replies
  • 2068 views

How to use scripts to determine whether photoshop opencl can be used. 

Or determine if there is a discrete graphics card 

This topic has been closed for replies.
Correct answer r-bin
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("cachePrefs"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

var openglEnabled = executeActionGet(r).getObjectValue(stringIDToTypeID("cachePrefs")).getBoolean(stringIDToTypeID("openglEnabled"));  

var useOpenCL = executeActionGet(r).getObjectValue(stringIDToTypeID("cachePrefs")).getObjectValue(stringIDToTypeID("openglAdvanced")).getBoolean(stringIDToTypeID("CLCompute"));  


alert(openglEnabled && useOpenCL);

 

Не? : )

2 replies

Participant
April 16, 2023

I got the solution thanks @jazz-y 

Legend
April 16, 2023
var GPU = systemInformation.match(/(GPUName:\s+)(.+)/),
openCL = systemInformation.match(/(IsOpenCLGPUCapable:\s+)(.+)/);

alert ('GPU Model: ' + GPU[2] + '\nOpen CL Capable: ' + openCL[2])
meadXAuthor
Known Participant
April 16, 2023

Thank you. Thank you for your help