Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bb5b292ab5b8c3e67624b0d6b8789a2@smtp.hushmail.com>
Date: Mon, 14 Jan 2013 03:05:45 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Changes to common-opencl.c

On 14 Jan, 2013, at 1:17 , magnum <john.magnum@...hmail.com> wrote:
> On 14 Jan, 2013, at 0:59 , Claudio André <claudioandre.br@...il.com> wrote:
>> Em 13-01-2013 21:39, magnum escreveu:
>>> 
>>> I can have a go at the parsing if you want. I really think we should use the provided getopt stuff if it can help us at all, and in this case it seems it has exactly the functionality needed.
>> 
>> Please do!

Attached is a format-patch. This is mostly for showing the getopt/list stuff, I think most of it should be moved/reworked.


>> 
>>> Given --device=1,2, what should the parser do? Fill an array somewhere?
>> 
>> Fill a new array. For example, in common-opencl.h
>> int ocl_device_list[MAXGPUS];
> 
> Apparently what I get from getopt will be a "struct listmain *gpu_devices" (see list.h). I can re-parse that to an array or you can use the struct as-is.

The patch currently fills such array but doesn't use it (other than set the legacy ocl_gpu_id to ocl_device_list[0] afterwards). BTW it leaves the rest of the array uninitialized, that should probably be fixed.

But I doubt we need that ocl_device_list array as intermediate carrier. You can instead take the do...while loop that currently fills the array, move it to common-opencl.c and use it directly for filling the real arrays instead.

>> I was thinking that (after the change) you still can use, on bull (to get CPU):
>> 
>> john --platform:1 --device:1
>> 
>> OR
>> john --devices:2
> 
> This could be supported, but to John's getopt both variants will use the same 'devices' option so we'd need to look if platform was used or not, to understand which syntax was used.

The patch currently supports legacy syntax. If a --platform option is given, only one --device is allowed, the array is not filled but ocl_gpu_id is set.

BTW the patch changes CUDA too but only allows one device and does not set any array.

magnum


Download attachment "0001-First-version-of-devices-N-.-parsing.-It-fills-an-ar.patch" of type "application/octet-stream" (7612 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.