Login Register


StringCalculationWithGPU filter_list
Author
Message
StringCalculationWithGPU #1
Hello developers, I have a stupid question Biggrin Can you create Py script that processes txt file on the GPU and deletes for example the row if there is the word 'sinister' for an example and it contains 30 mill rows. Would it be faster than the GPU and can you do that at all (if the CPU runs only one process with the script)

[Image: hungry-ladybug-43.localtunnel.me]

Confused Confused Confused
(This post was last modified: 08-16-2018, 10:02 AM by Mansispicher39.)

Reply

RE: StringCalculationWithGPU #2
(08-15-2018, 03:52 PM)Mansispicher39 Wrote: Hello developers, I have a stupid question Biggrin Can you create Py script that processes txt file on the GPU and deletes for example the row if there is the word 'sinister' for an example and it contains 30 mill rows. Would it be faster than the GPU and can you do that at all (if the CPU runs only one process with the script)

[Image: funny-pug-38.localtunnel.me]

Confused  Confused  Confused

you should search for "pycuda" if you have nvidia GPU. else you should look at PyOpenCL.

basic way to play with files is:

Code:
a = open("filename.extension", "rw") b = open("output.txt", "w") for line in a.readlines(): #go through each line    if line != match:        b.writelines(line) #only write the lines that dont have what you look for

This will leave you with 2 files, but you can easily delete the first one and you are left with the one you want. "match" should be a regular expression (more reading yay!) so it can find what you are looking for even if there is lots of text on the line. parallel computing (what a gpu is useful for) will not be this simple but at least you have some where to start

have fun Smile
Code:
  _______              _   _________   \      \            | | /        /   |      | _____  ____| | |   ____/ _____  _____  _____  _____   |   |  |/  _  \/      | \____   |/     \/     \/  ___\/  _  \   |      |    __/|  |   |/        |   |  |   |   \  \__ |   __/  /_______/\_____/\____|_/________/|  ____/\_____|_\____/\_____/                                   | |                                   |_/                         BTC Address:  bc1qds8uqnt4ga0zn9ftrm45cq9u9hfct0qluqes5a

Reply







Users browsing this thread: 1 Guest(s)