Changeset 2098


Ignore:
Timestamp:
Nov 15, 2010, 8:20:43 PM (11 years ago)
Author:
Sven Rech
Message:

OpenCL Threadamount GuiLogMessage

Location:
trunk/CrypPlugins/KeySearcher
Files:
2 edited

Legend:

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

    r2092 r2098  
    372372            KeySearcherOpenCLCode keySearcherOpenCLCode = null;
    373373            if (useOpenCL)
    374                 keySearcherOpenCLCode = new KeySearcherOpenCLCode(encryptedData, sender, CostMaster, 256 * 64);
     374                keySearcherOpenCLCode = new KeySearcherOpenCLCode(this, encryptedData, sender, CostMaster, 256 * 64);
    375375
    376376            try
  • trunk/CrypPlugins/KeySearcher/OpenCL/KeySearcherOpenCLCode.cs

    r2088 r2098  
    1111    class KeySearcherOpenCLCode
    1212    {
     13        private readonly KeySearcher keySearcher;
    1314        private byte[] encryptedData;
    1415        private IControlCost controlCost;
     
    2021        private Kernel openCLKernel = null;
    2122
    22         public KeySearcherOpenCLCode(byte[] encryptedData, IControlEncryption encryptionController, IControlCost controlCost, int maxKeys)
     23        public KeySearcherOpenCLCode(KeySearcher keySearcher, byte[] encryptedData, IControlEncryption encryptionController, IControlCost controlCost, int maxKeys)
    2324        {
     25            this.keySearcher = keySearcher;
    2426            this.encryptedData = encryptedData;
    2527            this.encryptionController = encryptionController;
     
    6163            keyTranslatorOfCode = keyTranslator;
    6264            this.openCLCode = code;
    63 
    64             ////Test:
    65             //System.IO.TextWriter tw = new System.IO.StreamWriter(@"C:\Users\sven\Test\test.txt");
    66             //tw.Write(code);
    67             //tw.Close();
    68 
     65           
    6966            return code;
    7067        }
     
    8178            {
    8279                var program = oclManager.CompileSource(CreateOpenCLBruteForceCode(keyTranslator));
     80                keySearcher.GuiLogMessage(string.Format("Using OpenCL with {0} threads.", keyTranslator.GetOpenCLBatchSize()), NotificationLevel.Info);
    8381                openCLKernel = program.CreateKernel("bruteforceKernel");
    8482                return openCLKernel;
Note: See TracChangeset for help on using the changeset viewer.