• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

How to use scripts to determine whether opencl can be used

Explorer ,
Apr 15, 2023 Apr 15, 2023

Copy link to clipboard

Copied

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

Or determine if there is a discrete graphics card 

TOPICS
Actions and scripting

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Guide , Apr 15, 2023 Apr 15, 2023
var GPU = systemInformation.match(/(GPUName:\s+)(.+)/),
openCL = systemInformation.match(/(IsOpenCLGPUCapable:\s+)(.+)/);

alert ('GPU Model: ' + GPU[2] + '\nOpen CL Capable: ' + openCL[2])

Votes

Translate

Translate
People's Champ , Apr 17, 2023 Apr 17, 2023
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")).getBoolea
...

Votes

Translate

Translate
Adobe
Guide ,
Apr 15, 2023 Apr 15, 2023

Copy link to clipboard

Copied

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

alert ('GPU Model: ' + GPU[2] + '\nOpen CL Capable: ' + openCL[2])

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 15, 2023 Apr 15, 2023

Copy link to clipboard

Copied

Thank you. Thank you for your help 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

Unfortunately, Photoshop 2020 prompts the error, only Photoshop 2022 and 2023 can run normally, how can 2020 be judged, or use the cmd command of. bat to judge? Thanks 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

systemInformation contains a string with system information in text form (similar to what you see in Photoshop's menu help -> system info). You can explore its contents yourself in previous versions of Photoshop and write a regular expression that will get the information you need.

I donā€™t see any reason to complicate the script and access the operating system command line, if this information is already in Photoshop, itā€™s enough just to extract it correctly (you can write a function that will work according to one or another algorithm depending on the app.version)

 
 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

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);

 

ŠŠµ? : )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

That's amazing. Thank you 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 17, 2023 Apr 17, 2023

Copy link to clipboard

Copied

@r-bin, я тŠ°Šŗ ŠæŠ¾Š½ŃŠ», чтŠ¾ Š½ŃƒŠ¶Š½Š¾ уŠ·Š½Š°Ń‚ŃŒ Š½Šµ сŠ¾ŃŃ‚Š¾ŃŠ½ŠøŠµ Š²ŠŗŠ»ŃŽŃ‡ŠµŠ½Š¾/Š²Ń‹ŠŗŠ»ŃŽŃ‡ŠµŠ½Š¾, Š° Š¼Š¾Š¶ŠµŃ‚ Š»Šø Š²ŠøŠ“ŠµŠ¾ŠŗŠ°Ń€Ń‚Š° (с тŠ¾Ń‡ŠŗŠø Š·Ń€ŠµŠ½Šøя Š¤Š¾Ń‚Š¾ŃˆŠ¾ŠæŠ°) ŠµŠ³Š¾ ŠøсŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Ń‚ŃŒ. Š’ systemInformation Š¼Š½ŠµŠ½ŠøŠµ Š¤Š¾Ń‚Š¾ŃˆŠ¾ŠæŠ° Š½Š° этŠ¾Ń‚ счŠµŃ‚ сŠ²ŠµŃ‚Šøтся Š²Š½Šµ Š·Š°Š²ŠøсŠøŠ¼Š¾ŃŃ‚Šø Š¾Ń‚ тŠ¾Š³Š¾, чтŠ¾ ŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Ń‚ŠµŠ»ŃŒ Š½Š°Ń‚Ń‹Ń€ŠŗŠ°Š» Š³Š°Š»Š¾Ń‡ŠŗŠ°Š¼Šø Š² рŠ°Š·Š“ŠµŠ»Šµ performance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Apr 18, 2023 Apr 18, 2023

Copy link to clipboard

Copied

LATEST
quote

@r-bin, я тŠ°Šŗ ŠæŠ¾Š½ŃŠ», чтŠ¾ Š½ŃƒŠ¶Š½Š¾ уŠ·Š½Š°Ń‚ŃŒ Š½Šµ сŠ¾ŃŃ‚Š¾ŃŠ½ŠøŠµ Š²ŠŗŠ»ŃŽŃ‡ŠµŠ½Š¾/Š²Ń‹ŠŗŠ»ŃŽŃ‡ŠµŠ½Š¾, Š° Š¼Š¾Š¶ŠµŃ‚ Š»Šø Š²ŠøŠ“ŠµŠ¾ŠŗŠ°Ń€Ń‚Š° (с тŠ¾Ń‡ŠŗŠø Š·Ń€ŠµŠ½Šøя Š¤Š¾Ń‚Š¾ŃˆŠ¾ŠæŠ°) ŠµŠ³Š¾ ŠøсŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Ń‚ŃŒ. Š’ systemInformation Š¼Š½ŠµŠ½ŠøŠµ Š¤Š¾Ń‚Š¾ŃˆŠ¾ŠæŠ° Š½Š° этŠ¾Ń‚ счŠµŃ‚ сŠ²ŠµŃ‚Šøтся Š²Š½Šµ Š·Š°Š²ŠøсŠøŠ¼Š¾ŃŃ‚Šø Š¾Ń‚ тŠ¾Š³Š¾, чтŠ¾ ŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Ń‚ŠµŠ»ŃŒ Š½Š°Ń‚Ń‹Ń€ŠŗŠ°Š» Š³Š°Š»Š¾Ń‡ŠŗŠ°Š¼Šø Š² рŠ°Š·Š“ŠµŠ»Šµ performance.


By @jazz-y

 

Š’Š¾Š·Š¼Š¾Š¶Š½Š¾. Š¢Š¾Š»ŃŒŠŗŠ¾ Š²Š¾Ń‚ этŠ¾ Š²ŃŃ‘ Š²ŠµŃ€ŃŠøя-Š·Š°Š²ŠøсŠøŠ¼Š¾Šµ Š¾Ń‡ŠµŠ½ŃŒ. Š’ CS6 Šø Š”Š”2020, Š½Š°ŠæрŠøŠ¼ŠµŃ€, сŠ¾Š²ŠµŃ€ŃˆŠµŠ½Š½Š¾ рŠ°Š·Š½Ń‹Šµ Š±ŃƒŠŗŠ¾Š²ŠŗŠø. ŠŸŃ€Šø этŠ¾Š¼ Š½Šø Š¾Š“Š½Š° Š½Šµ сŠ¾Š²ŠæŠ°Š“Š°ŠµŃ‚ с тŠ²Š¾ŠøŠ¼ Š²Š°Ń€ŠøŠ°Š½Ń‚Š¾Š¼, ŠŗŠ°Šŗ я ŠæŠ¾Š½ŃŠ» Š“Š»Ń 2023.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2023 Apr 16, 2023

Copy link to clipboard

Copied

I got the solution thanks @jazz-y 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines