Changeset 2149


Ignore:
Timestamp:
Dec 1, 2010, 8:51:59 PM (11 years ago)
Author:
Sven Rech
Message:

hopefully fixed keysearcher opencl bug now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/KeySearcher.cs

    r2146 r2149  
    298298        {
    299299            IsKeySearcherRunning = true;
    300 
    301             ((QuickWatch)QuickWatchPresentation).Dispatcher.BeginInvoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    302             {
    303                 openCLPresentationMutex.WaitOne();
    304                 ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.AmountOfDevices = 0;
    305                 openCLPresentationMutex.ReleaseMutex();
    306             }, null);
    307300
    308301            //either byte[] CStream input or CryptoolStream Object input
     
    481474                    userKey = oclManager.Context.CreateBuffer(MemFlags.USE_HOST_PTR, key.Length, new IntPtr((void*)ukp));
    482475
    483                 bruteforceKernel.SetArg(0, userKey);
     476               
    484477
    485478                int subbatches = keySearcherOpenCLSubbatchOptimizer.GetAmountOfSubbatches(keyTranslator);
     
    494487                float[] costArray = new float[subbatchSize];
    495488                Mem costs = oclManager.Context.CreateBuffer(MemFlags.READ_WRITE, costArray.Length * 4);
    496                 bruteforceKernel.SetArg(1, costs);
     489               
    497490
    498491                IntPtr[] globalWorkSize = { (IntPtr)subbatchSize };
     
    502495                for (int i = 0; i < subbatches; i++)
    503496                {
     497                    bruteforceKernel.SetArg(0, userKey);
     498                    bruteforceKernel.SetArg(1, costs);
    504499                    bruteforceKernel.SetArg(2, i * subbatchSize);
    505500                    oclManager.CQ[deviceIndex].EnqueueNDRangeKernel(bruteforceKernel, 1, null, globalWorkSize, null);
     
    756751        internal LinkedList<ValueKey> BruteForceWithLocalSystem(KeyPattern.KeyPattern pattern, bool redirectResultsToStatisticsGenerator = false)
    757752        {
     753            ((QuickWatch)QuickWatchPresentation).Dispatcher.BeginInvoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     754            {
     755                openCLPresentationMutex.WaitOne();
     756                ((QuickWatch)QuickWatchPresentation).OpenCLPresentation.AmountOfDevices = 0;
     757                openCLPresentationMutex.ReleaseMutex();
     758            }, null);
     759
    758760            if (!redirectResultsToStatisticsGenerator)
    759761            {
Note: See TracChangeset for help on using the changeset viewer.