Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ShapeComplementarityCalculator.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/scoring/sc/ShapeComplementarityCalculator.hh
11 /// @brief Headers for the Shape Complementarity Calculator
12 /// @author Luki Goldschmidt (luki@mbi.ucla.edu)
13 
14 #ifndef INCLUDED_core_scoring_sc_ShapeComplementarityCalculator_hh
15 #define INCLUDED_core_scoring_sc_ShapeComplementarityCalculator_hh
16 
17 // This code contains support for GPU acceleration using OpenCL.
18 // Build with scons option extras=opencl to enable GPU support.
19 //
20 // Note: Original Fotran code used floats rather than doubles. This code works
21 // correctly with either floats or core::Real, though core::Real is about 50%
22 // slower (tested on 64-bit machines). The code can be compiled with double (Real)
23 // precision floats by defining SC_PRECISION_REAL.
24 
25 // #define SC_PRECISION_REAL
26 // #define USEOPENCL
27 
28 // Core Headers
29 #include <core/types.hh>
30 #include <core/pose/Pose.fwd.hh>
34 #include <numeric/xyzVector.hh>
35 
36 //// C++ headers
37 #include <vector>
38 #include <string>
39 #include <utility/vector1.hh>
40 
41 namespace core {
42 namespace scoring {
43 namespace sc {
44 
45 ////////////////////////////////////////////////////////////
46 // core::scoring::sc namespace
47 ////////////////////////////////////////////////////////////
48 
49 ////////////////////////////////////////////////////////////
50 // Types
51 
52 
53 ////////////////////////////////////////////////////////////
54 // Shape Complementarity Calculator class definition
55 ////////////////////////////////////////////////////////////
56 
58 
59 public:
60 
63 
64  virtual int Calc();
65  virtual int Calc(core::pose::Pose const & pose, core::Size jump_id);
66 
67  // Static function that can be called without object instantiation
68  static core::Real CalcSc(core::pose::Pose const & pose, core::Size jump_id =1, int quick =0);
69 
70 protected:
71  // Surface generation configuration
72  virtual int AssignAttentionNumbers(std::vector<Atom>& atom);
73 
74 private:
75 
76  // Dot trimming
77  ScValue TrimPeripheralBand(std::vector<DOT> const &sdots, std::vector<const DOT*> &trimmed_dots);
78  int TrimPeripheralBandCheckDot(DOT const &dot, std::vector<DOT> const &sdots);
79 
80  // Shape Complementarity Kernel functions for parallalization
81  int CalcNeighborDistance(int const molecule, std::vector<const DOT*> const &my_dots, std::vector<const DOT*> const &their_dots);
82  DOT const *CalcNeighborDistanceFindClosestNeighbor(DOT const &dot1, std::vector<const DOT*> const &their_dots);
83 
84 #ifdef USEOPENCL
85  protected:
86  basic::gpu::GPU gpu;
87  float gpuTrimPeripheralBand(const std::vector<DOT> &dots, std::vector<const DOT*> &trimmed_dots);
88  int gpuFindClosestNeighbors(const std::vector<const DOT*> &my_dots, const std::vector<const DOT*> &their_dots, std::vector<const DOT*> &neighbors);
89  core::Real GetTimerMs(clock_t &start);
90 
91  public:
92  void gpuInit();
93 #endif
94 
95 
96 };
97 
98 } //namespace sc
99 } //namespace filters
100 } //namespace protocols
101 
102 #endif
103