1
votes

I have a powershell script, Find/replace string with carriage return and line feed in PowerShell, that I often run. It parses many files and naturally, it utilizes a majority of the CPU (2 cores).

Is there a way to utilize GPU acceleration in powershell?

1
What kind of processing would you like to do?Vincent Hubert
Read the file, parse the file, save as a new file, repeat on all files in the defined folder. The ultimate goal is to have a finished file that can be easily imported into MySQL.Jerry Sweeton

1 Answers

2
votes

The script you have there is likely not CPU-bound. It definitely cannot use more than one of your cores, i.e. 50 %. I'm fairly confident that the slowest part of that is reading and writing the files.

There are a few tasks that can be done very efficiently by the GPU, but for that the data already has to be in memory. That is, the slowest part (reading the files and writing them afterwards) still remains.

Then there is the case that the GPU is well-suited for doing the same or similar operations on large amounts of data, but text replacement (regexes even less so) is a different beast. Keep in mind that GPUs are very efficient at shuffling around large arrays of floating-point numbers. Characters are anything but that.